LuaDocs/AudioManager

From Data Realms Wiki

(Difference between revisions)
Jump to: navigation, search
LuaBot (Talk)
(AudioManager - Automatically generated by LuaBot)
Newer edit →

Revision as of 02:50, 20 August 2009

Contents

Has no parent class

Generic Class. The singleton manager of the WAV sound effects and OGG music playback.

Go back to Class Index


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.


PlaySound

Starts playing a certain sound sample

Arguments:

  • The path to the .wav file to play

Return value:

None.


PlaySound

Starts playing the next sample of a certain Sound.

Arguments:

  • Pointer to the Sound to start playing. Ownership is NOT transferred!
  • The priority of this sound; higher gives it a higher likelyhood of getting mixed compared to lower-priority samples.
  • Distance attenuation scalar: 0 = full volume, 1.0 = max distant, but not silent.
  • The pitch modifier for this sound. 1.0 yields unmodified frequency.

Return value:

Whether or not playback of the Sound was successful.


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.


StopSound

Stops playing a certain sound sample

Arguments:

  • The path to the .wav file to stop playing

Return value:

None.


StopSound

Stops playing a certain Sound's samples.

Arguments:

  • Pointer to the Sound to stop playing. Ownership is NOT transferred!

Return value:

Whether playback of the sound was successfully stopped, or even found.


FadeOutSound

Fades out playback of a specific sound

Arguments:

  • Pointer to the Sound to fade out playing. Ownership is NOT transferred!
  • The amount of time, in ms, to fade out over.

Return value:

None.


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.


Go back to Class Index

Personal tools