|
Monad Engine da02fba2
> Undercity Codex_
|
Single playable audio clip backed by a decoded miniaudio stream. More...
#include <Audio.h>
Public Member Functions | |
| ~Audio () | |
| void | SetPosition (const glm::vec3 &position) |
| Place the emitter at a world-space position (3D spatialisation). | |
| void | Play (bool loop=false) |
Start playback. Pass true to loop forever. | |
| void | Stop () |
| Halt playback if currently playing; no-op otherwise. | |
| bool | IsPlaying () const |
| True between Play() and natural end / Stop(). | |
| void | SetVolume (float volume) |
| Linear gain in [0, 1]. Values above 1 amplify but may clip. | |
| float | GetVolume () const |
Static Public Member Functions | |
| static std::shared_ptr< Audio > | Load (const std::string &path) |
| Decode an audio file from disk and return a shared instance. | |
Single playable audio clip backed by a decoded miniaudio stream.
| bool mnd::Audio::IsPlaying | ( | ) | const |
|
static |
Decode an audio file from disk and return a shared instance.
| path | Path under the assets directory; resolved by FileSystem. |
Definition at line 74 of file Audio.cpp.
References mnd::Engine::GetAudioManager(), mnd::AudioManager::GetEngine(), mnd::Engine::GetFileSystem(), mnd::Engine::GetInstance(), and mnd::FileSystem::LoadAssetFile().
Referenced by mnd::AudioComponent::LoadProperties().
| void mnd::Audio::Play | ( | bool | loop = false | ) |
| void mnd::Audio::SetPosition | ( | const glm::vec3 & | position | ) |
| void mnd::Audio::SetVolume | ( | float | volume | ) |
| void mnd::Audio::Stop | ( | ) |