Module music
Music Lua module.
Typical usage would be something like:
music.load( "intro" ) -- Load the song music.play() -- Play it
Functions
delay (situation, delay) | Delays a rechoose. |
load (name) | Loads a song. |
play () | Plays the loaded song. |
stop () | Stops playing the current song. |
isPlaying () | Checks to see if something is playing. |
current () | Gets the name of the current playing song. |
Functions
- delay (situation, delay)
-
Delays a rechoose.
Parameters:
- situation string Situation to choose.
- delay number Delay in seconds.
Usage:
music.delay( "ambient", 5.0 ) -- Rechooses ambient in 5 seconds
- load (name)
-
Loads a song.
Parameters:
- name string Name of the song to load.
- play ()
- Plays the loaded song.
- stop ()
- Stops playing the current song.
- isPlaying ()
-
Checks to see if something is playing.
Returns:
-
boolean
true if something is playing.
- current ()
-
Gets the name of the current playing song.
Returns:
- string The name of the current playing song or "none" if no song is playing.
- number The current offset inside the song (0. if music is none).
Usage:
songname, songplayed = music.current()