Audio Class
Layer which handles the Lua-facing side of loading and playing audio.
Method Index
- dumpSoundArchive(out_dir)
- findIndexOfCurrentTrack()
- init()
- initSpeech(speech_file)
- notifyJukebox()
- onMusicOver()
- pauseBackgroundTrack()
- playBackgroundTrack(index)
- playNextBackgroundTrack()
- playNextOrPreviousBackgroundTrack(direction)
- playPreviousBackgroundTrack()
- playRandomBackgroundTrack()
- playSound(name, where, is_announcement)
- playSoundEffects(play_effects)
- releaseChannel(channel)
- reserveChannel()
- setAnnouncementVolume(volume)
- setBackgroundVolume(volume)
- setSoundVolume(volume)
- soundExists(sound)
- stopBackgroundTrack()
Member Index
- app
- background_music
- background_paused
- background_playlist
- has_bg_music
- load_music
- not_loaded
- old_bg_music_volume
- sound_archive
- sound_fx
- speech_file_name
function Audio:Audio(app)
Parameters:
Name | Type | Description |
---|---|---|
app | ? | ? |
Declared on: line 32 of Lua/audio.lua.
function Audio:dumpSoundArchive(out_dir)
Parameters:
Name | Type | Description |
---|---|---|
out_dir | ? | ? |
Declared on: line 232 of Lua/audio.lua.
function Audio:init()
Declared on: line 49 of Lua/audio.lua.
function Audio:initSpeech(speech_file)
Parameters:
Name | Type | Description |
---|---|---|
speech_file | ? | ? |
Declared on: line 177 of Lua/audio.lua.
function Audio:notifyJukebox()
search for jukebox and notify it to update its play button
Declared on: line 512 of Lua/audio.lua.
function Audio:onMusicOver()
Declared on: line 475 of Lua/audio.lua.
function Audio:pauseBackgroundTrack()
Returns whether music is currently paused or not after the call.
If nil is returned music might either be playing or completely stopped.
Declared on: line 362 of Lua/audio.lua.
function Audio:playBackgroundTrack(index)
Plays a given background track.
Playback will only start if the configuration says it's ok. (play_music = true)
Parameters:
Name | Type | Description |
---|---|---|
index | ? | Index of the track to play in the playlist. |
Declared on: line 420 of Lua/audio.lua.
function Audio:playNextOrPreviousBackgroundTrack(direction)
Parameters:
Name | Type | Description |
---|---|---|
direction | ? | ? |
Declared on: line 332 of Lua/audio.lua.
function Audio:playSound(name, where, is_announcement)
Parameters:
Name | Type | Description |
---|---|---|
name | ? | ? |
where | ? | ? |
is_announcement | ? | ? |
Declared on: line 255 of Lua/audio.lua.
function Audio:playSoundEffects(play_effects)
Parameters:
Name | Type | Description |
---|---|---|
play_effects | ? | ? |
Declared on: line 500 of Lua/audio.lua.
function Audio:releaseChannel(channel)
Parameters:
Name | Type | Description |
---|---|---|
channel | ? | ? |
Declared on: line 528 of Lua/audio.lua.
function Audio:reserveChannel()
Declared on: line 520 of Lua/audio.lua.
function Audio:setAnnouncementVolume(volume)
Parameters:
Name | Type | Description |
---|---|---|
volume | ? | ? |
Declared on: line 508 of Lua/audio.lua.
function Audio:setBackgroundVolume(volume)
Parameters:
Name | Type | Description |
---|---|---|
volume | ? | ? |
Declared on: line 482 of Lua/audio.lua.
function Audio:setSoundVolume(volume)
Parameters:
Name | Type | Description |
---|---|---|
volume | ? | ? |
Declared on: line 491 of Lua/audio.lua.
function Audio:soundExists(sound)
Returns whether the given sound (either a string or a number)
exists in the sound archive
Parameters:
Name | Type | Description |
---|---|---|
sound | ? | The sound to look for, either a string (name) or a number (position in the list of sounds) |
Declared on: line 293 of Lua/audio.lua.
function Audio:stopBackgroundTrack()
Stops playing background music for the time being.
Does not affect the configuration setting play_music.
Declared on: line 407 of Lua/audio.lua.