LuaDocs/AudioManager
From Data Realms Wiki
Contents |
Has no parent class
Generic Class. The singleton manager of the WAV sound effects and OGG music playback.
Properties
SoundsVolume
The volume of all sounds to a specific volume. Does not affect music.The desired volume scalar. 0.0-1.0.
MusicVolume
The music to a specific volume.The desired volume scalar. 0.0-1.0.
Functions
PlayMusic
Starts playing a certain WAVE, MOD, MIDI, OGG, MP3 file in the music channel.
Arguments:
- The path to the music file to play.
- The number of times to loop the song. 0 means play once. -1 means play infinitely until stopped.
- The volume override for music for this song only. < 0 means no override.
Return value:
None.
QueueMusicStream
Queues up another path to a stream that will be played after the current one is done. Can be done several times to queue up many tracks. The last track in the list will be looped infinitely.
Arguments:
- The path to the music file to play after the current one.
Return value:
None.
QueueSilence
Queues up a period of silence in teh music stream playlist.
Arguments:
- The number of secs to wait before going to the next stream.
Return value:
None.
ClearMusicQueue
Clears the music queue.
Arguments:
- None.
Return value:
None.
SetSoundAttenuation
Sets/updates the distance attenuation for a specific sound. Will only have an effect if the sound is currently being played.
Arguments:
- A pointer to a Sound object. Ownership IS NOT transferred!
- Distance attenuation scalar: 0 = full volume, 1.0 = max distant, but not silent.
Return value:
Whetehr a smaple of the Sound is currently being played by any of the channels, and the attenuation was successfully set.
IsPlaying
Reports whetehr a certain Sound's last played sample is being played currently.
Arguments:
- A pointer to a Sound object. Ownership IS NOT transferred!
Return value:
Whether the LAST sample that was played of the Sound is currently being played by any of the channels.
IsMusicPlaying
Reports whetehr any music stream is currently playing.
Arguments:
- None.
Return value:
Whether any music stream is currently playing.
StopMusic
Stops playing a the music channel.
Arguments:
- None.
Return value:
None.
SetMusicPosition
Stops playing a the music channel.
Arguments:
- None.
Return value:
None.
StopAll
Stops playing a the music channel.
Arguments:
- None.
Return value:
None.