#pragma once #include #include #include #include "miniwin/miniwin.h" #include "utils/stdcompat/optional.hpp" namespace devilution { class SoundSample final { public: void Release(); bool IsPlaying(); void Play(int lVolume, int lPan, int channel = -1); void Stop(); int SetChunkStream(HANDLE stormHandle); /** * @brief Sets the sample's WAV, FLAC, or Ogg/Vorbis data. * @param fileData Buffer containing the data * @param dwBytes Length of buffer * @return 0 on success, -1 otherwise */ int SetChunk(std::unique_ptr file_data, DWORD dwBytes); int GetLength(); private: std::unique_ptr file_data_; std::optional stream_; }; } // namespace devilution