Get the sound playback rate. This 1 for the default speed.
This value is not clamped (any value greater than 0 is valid),
but the underlying audio system might not play the sound at the required
rate if it's very low or very high.
Returns number
getSeek
getSeek(): number
Get the sound seek.
Returns number
getSpatialPosition
getSpatialPosition(axis): number
Get the sound spatial position.
Parameters
axis: "x" | "y" | "z"
Returns number
getVolume
getVolume(): number
Get the sound volume.
Returns number
A float from 0 to 1.
isLoaded
isLoaded(): boolean
Returns true if the associated howl is fully loaded.
Returns boolean
off
off(event, handler): this
Removes an event listener to the howl.
Parameters
event: HowlEvent
handler: HowlCallback
Returns this
on
on(event, handler): this
Adds an event listener to the howl.
Parameters
event: HowlEvent
handler: HowlCallback
Returns this
once
once(event, handler): this
Adds an event listener to the howl that removes itself after being called.
If the event is play and the sound is being played, the handler is
called synchronously.
Parameters
event: HowlEvent
handler: HowlCallback
Returns this
pause
pause(): this
Pauses playback of the sound, saving the seek of playback.
Returns this
The current instance for chaining.
paused
paused(): boolean
Check if the sound is currently paused.
Returns boolean
play
play(): this
Begins playback of the sound, or if the Howl is still loading, schedule playing for once it loads.
Returns this
The current instance for chaining.
playing
playing(): boolean
Check if the sound is currently playing.
Note that a loading sound is considered as playing (as it will be
played as soon as it's loaded). To avoid loading at runtime, prefer
to preload the sounds.
Returns boolean
setLoop
setLoop(loop): this
Set if the sound is looping.
Parameters
loop: boolean
Returns this
The current instance for chaining.
setMute
setMute(mute): this
Set if the sound is muted.
Parameters
mute: boolean
Returns this
The current instance for chaining.
setRate
setRate(rate): this
Set the playback rate.
This value is not clamped (any value greater than 0 is valid),
but the underlying audio system might not play the sound at the required
rate if it's very low or very high.
Parameters
rate: number
Returns this
The current instance for chaining.
setSeek
setSeek(seek): this
Set the sound seek.
Parameters
seek: number
Returns this
The current instance for chaining.
setSpatialPosition
setSpatialPosition(x, y, z): this
Set the sound spatial position.
Parameters
x: number
y: number
z: number
Returns this
The current instance for chaining.
setVolume
setVolume(volume): this
Set the sound volume.
Parameters
volume: number
A float from 0 to 1. The value is clamped if too high or too low.
A thin wrapper around a Howl object with:
setRate
to ensure a valid value is passed to Howler.js.setVolume
so that the volume is always between 0 and 1.Memberof
gdjs HowlerSound