class

Gosu::Sample

Inherits Reference / Object

A sample is a short sound that is completely loaded in memory, can be played multiple times at once and offers very flexible playback parameters. Use samples for everything that's not music.

See Gosu::Song

Constructors

new(filename : String)

Loads a sample from a file.

Source

Instance methods

play(volume : Float64 = 1.0, speed : Float64 = 1.0, looping : Bool = false) : Gosu::Channel

Plays the sample without panning.

volume see Channel#volume=

speed see Channel#speed=

looping whether the sample should play in a loop. If you pass true, be sure to store the return value of this method so that you can later stop the looping sound.

See #play_pan

Source
play_pan(pan : Float64 = 0.0, volume : Float64 = 1.0, speed : Float64 = 1.0, looping : Bool = false) : Gosu::Channel

Plays the sample with panning.

pan see Channel#pan=

volume see Channel#volume=

speed see Channel#speed=

looping whether the sample should play in a loop. If you pass true, be sure to store the return value of this method so that you can later stop the looping sound.

See #play

Source