Parent element
Readonly
idThe current unique ID for this instance.
Static
Readonly
PADDINGExtra padding, in seconds, to deal with low-latecy of HTMLAudio.
Static
prefixedIf the sound instance should loop playback
If the current instance is set to loop
true
if the sound is muted
Set the muted state of the instance
Pauses the sound.
If the instance is paused, if the sound or global context is paused, this could still be false.
The current playback progress from 0 to 1.
Set the instance speed from 0 to 1
Current speed of the instance. This is not the actual speed since it takes into account the global context and the sound volume.
Get the set the volume for this instance from 0 to 1
Current volume of the instance. This is not the actual volume since it takes into account the global context and the sound volume.
Don't use after this.
Calls each of the listeners registered for a given event.
Return an array listing the events for which the emitter has registered listeners.
Return the number of listeners listening to a given event.
Return the listeners registered for a given event.
Add a listener for a given event.
Optional
context: anyAdd a one-time listener for a given event.
Optional
context: anyCall whenever the loop, speed or volume changes
Handle changes in paused state, either globally or sound or instance
Remove all listeners, or those of the specified event.
Optional
event: string | symbolRemove the listeners of a given event.
Optional
fn: (...args: any[]) => voidOptional
context: anyOptional
once: booleanSet a property by name, this makes it easy to chain values
Name of the property to set
Value to set property to
Stop the sound playing
To string method for instance.
The string representation of instance.
Instance which wraps the
<audio>
element playback.Memberof
htmlaudio