Home

Module music

Music Lua module. Typical usage would be something like:
 music.load( "intro" ) -- Load the song
 music.play() -- Play it
 

Functions

music.current () Gets the name of the current playing song.
music.delay (situation, delay) Delays a rechoose.
music.isPlaying () Checks to see if something is playing.
music.load (name) Loads a song.
music.play () Plays the loaded song.
music.stop () Stops playing the current song.


Functions

music.current ()
Gets the name of the current playing song.

Usage:

songname, songplayed = music.current()

Return value:

The name of the current playing song or "none" if no song is playing, and the current offset inside the song (0. if music is none).
music.delay (situation, delay)
Delays a rechoose.

Parameters

  • situation: Situation to choose.
  • delay: Delay in seconds.

Usage:

music.delay( "ambient", 5.0 ) -- Rechooses ambient in 5 seconds
music.isPlaying ()
Checks to see if something is playing.

Return value:

true if something is playing.
music.load (name)
Loads a song.

Parameters

  • name: Name of the song to load.
music.play ()
Plays the loaded song.
music.stop ()
Stops playing the current song.

Valid XHTML 1.0!