Naev

Module music

Music Lua module.

Typical usage would be something like:

 music.load( "intro" ) -- Load the song
 music.play() -- Play it
 

Functions

choose (situation) Delays a rechoose.
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.
getVolume (log) Gets the volume level of the music.


Functions

choose (situation)
Delays a rechoose.

Parameters:

  • situation string Situation to choose.

Usage:

    music.choose( "ambient" ) -- Rechooses ambient in 5 seconds
    
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()
    
getVolume (log)
Gets the volume level of the music.

Parameters:

  • log boolean Whether or not to get the volume in log scale.

Returns:

    number Volume level of the music.
generated by LDoc 1.4.6 Last updated 2022-10-02 16:01:35