class

Gosu::Song

Inherits Reference / Object

Songs are less flexible than samples in that only one can be played at a time, with no panning or speed control.

See Gosu::Sample

Constructors

new(filename : String)

Loads a song from a file.

Source

Class methods

current_song

Returns the song currently being played (even if it's paused), or nil if no song is playing.

Source

Instance methods

pause

Pauses playback of the song. The current song is unchanged.

Source
paused?

Returns true if this song is the current song and playback is paused.

Source
play(looping : Bool = false)

Starts or resumes playback of the song.

If another song is currently playing, it will be stopped and this song will be set as the current song.

If looping is false, the current song will be set to nil when this song finishes.

looping whether the song should play in a loop.

Source
playing?

Returns whether the song is playing.

Source
stop

Stops playback if this song is the current song. The current song is set to nil.

Source
volume

Returns the song's playback volume.

Source
volume=(double : Float64)

Sets the song's playback volume.

Source