Module music

A controllable OGG Vorbis audio stream.

Music extends BoundObject

Properties

volume Minimum 0, maximum 1
loop (bool) Whether the music should loop.

Class Methods

Music:new (...) Create a new Music instance

Instance Methods

music:play () Play the Music
music:pause () Pause the Music
music:stop () Stop the Music and rewind

Hooks

ended (self) Called when the Music ends.


Properties

Properties. Significant fields on an instance.
volume
Minimum 0, maximum 1
loop
(bool) Whether the music should loop.

Class Methods

Class Methods. Must be called on Class, with a capital leading character. e.g. Class:method("foo")
Music:new (...)
Create a new Music instance

Parameters:

  • ... string A variable list of OGG files to load as a sequence. The music will play starting from the first file. The last file will be looped if loop is true.

Returns:

    Music

Usage:

    scene.music = Music:new("media/music/intro.ogg",
                            "media/music/loop.ogg")

Instance Methods

Instance Methods. Must be called on an instance of Class. e.g. instance:method("foo")
music:play ()
Play the Music

Returns:

    nil
music:pause ()
Pause the Music

Returns:

    nil
music:stop ()
Stop the Music and rewind

Returns:

    nil

Hooks

Hooks. Callbacks implemented in subclasses to customize behavior. Hooks are called on individual instances.
ended (self)
Called when the Music ends.

This is only called if loop is false

Parameters:

  • self Music The instance
generated by LDoc 1.3.12