Manages playing/combining audio effects and background music.
More...
|
| this () |
| Initialize SDL_Mixer .
|
|
| ~this () |
| Cleanup SDL_Mixer audio.
|
|
void | AddAudioResource (string audioName, string audioPath) |
| Load an AudioResource from a given file name.
|
|
void | PlayIndefinitely (string audio, int volume=10) |
| Play a given sound indefinitely.
|
|
void | StopBackgroundMusic () |
| Stop playing all sounds that are playing indefinitely.
|
|
void | PlayEffect (string audio, int volume=20, int loops=0) |
| Play a given sound a certain number of times.
|
|
void | StopAllEffects () |
| Stop playing all one-time sounds that are playing.
|
|
|
AudioResource[string] | mAudioResourceMap |
| Stored AudioResource instances.
|
|
AudioRequest | mBackgroundMusic |
| The currently playing background music's AudioRequest.
|
|
bool | mBackgroundMusicActive = false |
| Whether any background music is currently being playes.
|
|
AudioRequest[] | mEffects |
| The currently playing sound effects that will not loop forever.
|
|
Manages playing/combining audio effects and background music.
Instances of this class store loaded AudioResource and AudioRequest objects.
- See also
- AudioResource
-
AudioRequest
◆ AddAudioResource()
void AudioManager::AddAudioResource |
( |
string | audioName, |
|
|
string | audioPath ) |
|
inline |
Load an AudioResource from a given file name.
- Parameters
-
audioName | the name to use to reference this sound in the future. |
audioPath | the path to a .wav file containing the audio. |
◆ PlayEffect()
void AudioManager::PlayEffect |
( |
string | audio, |
|
|
int | volume = 20, |
|
|
int | loops = 0 ) |
|
inline |
Play a given sound a certain number of times.
- Parameters
-
audio | the name of the audio source to play. |
volume | an int controlling the volume at which to play. |
loops | the number of times to play the effect (default: 0 ). |
◆ PlayIndefinitely()
void AudioManager::PlayIndefinitely |
( |
string | audio, |
|
|
int | volume = 10 ) |
|
inline |
Play a given sound indefinitely.
- Parameters
-
audio | the name of the audio source to play. |
volume | an int controlling the volume at which to play. |
The documentation for this class was generated from the following file: