Pause the sound, so we can resume it later via play()
Optionalid: number
The id (from play()) of the specific instance to pause. Omit
to pause all instances.
Play the sound, as a new, independent instance (the same sound can be played more than once concurrently)
An id for this specific instance of the sound, for use with the other methods below, so they can control this instance without affecting any other concurrently-playing instance of the same sound
Report if the sound is currently playing
Optionalid: number
The id (from play()) of the specific instance to check. Omit
to report if any instance of the sound is playing.
Get the playback rate (speed) of the sound. 1 is normal, 2 is twice as fast (and an octave higher), and 0.5 is half as fast (and an octave lower).
Optionalid: number
The id (from play()) of the specific instance to query. Omit
to query the most recent instance.
Change the playback rate (speed) of the sound. Since a faster sound is also higher, this is how to play one recording at different pitches.
The new rate: 1 is normal, 2 is twice as fast, and 0.5 is half as fast
Optionalid: number
The id (from play()) of the specific instance to change.
Omit to change all instances.
Get the current playback position (in seconds)
Optionalid: number
The id (from play()) of the specific instance to query. Omit
to query the most recent instance.
Move the playback position to seek (in seconds)
The new playback position, in seconds
Optionalid: number
The id (from play()) of the specific instance to move. Omit
to move the most recent instance.
Stop playing the sound, resetting its playback position to the start
Optionalid: number
The id (from play()) of the specific instance to stop. Omit
to stop all instances.
Get the volume of the sound
Optionalid: number
The id (from play()) of the specific instance to query. Omit
to query the most recent instance.
Change the volume of the sound
The new volume, from 0 (silent) to 1 (full)
Optionalid: number
The id (from play()) of the specific instance to change.
Omit to change all instances.
An abstract representation of a sound
We use ISound so that the rest of JetLag doesn't need to know about Howler, but an ISound is really just a Howl object.
NB: Sound effects don't currently pause when a pause screen is showing.