Module CorsixTH.CorsixTH.Lua.audio
Layer which handles the Lua-facing side of loading and playing audio.
Functions
| Audio:pauseBackgroundTrack () | Pauses or unpauses background music depending on the current state. |
| Audio:playBackgroundTrack (index) | Plays a given background track. |
| Audio:setSoundStage () | Set the visual area for sound effects playback |
| Audio:soundExists (sound) | Returns whether the given sound (either a string or a number) exists in the sound archive |
| Audio:stopBackgroundTrack () | Stops playing background music for the time being. |
Functions
- Audio:pauseBackgroundTrack ()
- Pauses or unpauses background music depending on the current state. Returns whether music is currently paused or not after the call. If nil is returned music might either be playing or completely stopped.
- Audio:playBackgroundTrack (index)
-
Plays a given background track.
Playback will only start if the configuration says it's ok. (play_music = true)
Parameters:
- index Index of the track to play in the playlist.
- Audio:setSoundStage ()
- Set the visual area for sound effects playback
- Audio:soundExists (sound)
-
Returns whether the given sound (either a string or a number)
exists in the sound archive
Parameters:
- sound The sound to look for, either a string (name) or a number (position in the list of sounds)
- Audio:stopBackgroundTrack ()
- Stops playing background music for the time being. Does not affect the configuration setting play_music.