![]() |
Leviathan
0.8.0.0
Leviathan game engine
|
Manages loading the audio library and provides some helpers. More...
#include <SoundDevice.h>
Public Member Functions | |
DLLEXPORT | SoundDevice () |
DLLEXPORT | ~SoundDevice () |
DLLEXPORT bool | Init (bool simulatesound=false, bool noconsolelog=false) |
DLLEXPORT void | Release () |
DLLEXPORT void | Tick (int PassedMs) |
DLLEXPORT void | SetSoundListenerPosition (const Float3 &pos, const Float4 &orientation) |
Loads the file and plays the sound. More... | |
DLLEXPORT void | SetGlobalVolume (float vol) |
DLLEXPORT void | Play2DSoundEffect (const std::string &filename) |
Plays a 2d sound without possibility of interrupting. More... | |
DLLEXPORT AudioSource::pointer | Play2DSound (const std::string &filename, bool looping, bool startpaused) |
Plays a 2d sound with options. More... | |
DLLEXPORT AudioSource::pointer | CreateProceduralSound (ProceduralSoundData::pointer data, const char *soundname) |
Opens an audio source from a procedural data stream. More... | |
DLLEXPORT void | BabysitAudio (AudioSource::pointer audio) |
This class holds the audio source until it has finished playing and then releases the reference. More... | |
DLLEXPORT cAudio::IAudioManager * | GetAudioManager () |
Static Public Member Functions | |
static DLLEXPORT std::vector< std::string > | GetAudioDevices (size_t *indexofdefault=nullptr) |
Returns a list of audio playback devices. More... | |
Manages loading the audio library and provides some helpers.
Definition at line 20 of file SoundDevice.h.
SoundDevice::SoundDevice | ( | ) |
Definition at line 20 of file SoundDevice.cpp.
SoundDevice::~SoundDevice | ( | ) |
Definition at line 21 of file SoundDevice.cpp.
DLLEXPORT void SoundDevice::BabysitAudio | ( | AudioSource::pointer | audio | ) |
This class holds the audio source until it has finished playing and then releases the reference.
Definition at line 209 of file SoundDevice.cpp.
DLLEXPORT AudioSource::pointer SoundDevice::CreateProceduralSound | ( | ProceduralSoundData::pointer | data, |
const char * | soundname | ||
) |
Opens an audio source from a procedural data stream.
soundname | Name for this audio source. Should be at least somewhat unique |
Definition at line 197 of file SoundDevice.cpp.
|
static |
Returns a list of audio playback devices.
indexofdefault | Returns the index of the default device (if not null) |
Definition at line 216 of file SoundDevice.cpp.
|
inline |
Definition at line 73 of file SoundDevice.h.
bool SoundDevice::Init | ( | bool | simulatesound = false , |
bool | noconsolelog = false |
||
) |
simulatenosound | If true the sound device isn't initialized to simulate not having a valid audio device (or if the user just doesn't want sound) |
Definition at line 26 of file SoundDevice.cpp.
DLLEXPORT AudioSource::pointer SoundDevice::Play2DSound | ( | const std::string & | filename, |
bool | looping, | ||
bool | startpaused | ||
) |
Plays a 2d sound with options.
Definition at line 170 of file SoundDevice.cpp.
DLLEXPORT void SoundDevice::Play2DSoundEffect | ( | const std::string & | filename | ) |
Plays a 2d sound without possibility of interrupting.
Definition at line 153 of file SoundDevice.cpp.
void SoundDevice::Release | ( | ) |
Definition at line 99 of file SoundDevice.cpp.
DLLEXPORT void SoundDevice::SetGlobalVolume | ( | float | vol | ) |
vol | The volume [0.f, 1.f] |
Definition at line 143 of file SoundDevice.cpp.
DLLEXPORT void SoundDevice::SetSoundListenerPosition | ( | const Float3 & | pos, |
const Float4 & | orientation | ||
) |
Loads the file and plays the sound.
This creates a temporary SoundEffect on a background thread that is loaded from the file and destroyed once it finishes
Definition at line 121 of file SoundDevice.cpp.
void SoundDevice::Tick | ( | int | PassedMs | ) |
Definition at line 110 of file SoundDevice.cpp.