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.

Public Class Methods


Public Instance Methods


play (vol=1, speed=1, looping=false)

Plays the sample without panning.

Returns a SampleInstance.

volume:Can be anything from 0.0 (silence) to 1.0 (full volume).
speed:Playback speed is only limited by the underlying audio library, and can accept very high or low values. Use 1.0 for normal playback speed.

play_pan (pan=0, vol=1, speed=1, looping=false)

Plays the sample with panning. Even if pan is 0.0, the sample will not be as loud as if it were played by calling play() due to the way the panning works.

Returns a SampleInstance.

volume:Can be anything from 0.0 (silence) to 1.0 (full volume).
speed:Playback speed is only limited by the underlying audio library, and can accept very high or low values. Use 1.0 for normal playback speed.