Home

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. ( situation, delay )

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. ( name )

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:

  1. string The name of the current playing song or "none" if no song is playing.
  2. number The current offset inside the song (0. if music is none).

Usage:

    songname, songplayed = music.current()
generated by LDoc 1.4.3 Last updated 2020-06-26 02:01:09