42 void Play(
bool loop =
false);
56 static std::shared_ptr<Audio>
Load(
const std::string &path);
59 std::unique_ptr<ma_sound> m_sound;
60 std::unique_ptr<ma_decoder> m_decoder;
61 std::vector<char> m_buffer;
Single playable audio clip backed by a decoded miniaudio stream.
void Play(bool loop=false)
Start playback. Pass true to loop forever.
void Stop()
Halt playback if currently playing; no-op otherwise.
void SetPosition(const glm::vec3 &position)
Place the emitter at a world-space position (3D spatialisation).
void SetVolume(float volume)
Linear gain in [0, 1]. Values above 1 amplify but may clip.
bool IsPlaying() const
True between Play() and natural end / Stop().
static std::shared_ptr< Audio > Load(const std::string &path)
Decode an audio file from disk and return a shared instance.