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.
pause (disable) Pauses the music engine.
stop (disable) 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. Will resume paused songs.
pause (disable)
Pauses the music engine.

Parameters:

  • disable boolean Whether or not to disable music changes until music.play() is called. This disables all in-game music changes such as taking off.
stop (disable)
Stops playing the current song.

Parameters:

  • disable boolean Whether or not to disable music changes until music.play() is called. This disables all in-game music changes such as taking off.
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 (-1. 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 2023-02-06 13:16:19