Optional _fadeOptional gainPrivate hasOptional pannerOptional sourcePrivate stopChecks if the audio is currently playing.
True if the audio is playing, false otherwise.
Gets the position of the audio source in 3D space (HRTF panning only).
The [x, y, z] coordinates of the audio source.
Throws an error if the sound has been cleaned up or if HRTF panning is not used.
Sets the position of the audio source in 3D space (HRTF panning only).
The [x, y, z] coordinates of the audio source.
Throws an error if the sound has been cleaned up or if HRTF panning is not used.
Gets the stereo panning value.
The current stereo pan value, or null if stereo panning is not applicable.
Sets the stereo panning value.
The stereo pan value to set, between -1 (left) and 1 (right).
Throws an error if stereo panning is not available, if the sound has been cleaned up, or if the value is out of bounds.
Gets the 3D audio options if HRTF panning is used.
The current 3D audio options.
Throws an error if the sound has been cleaned up or if HRTF panning is not used.
Sets the 3D audio options for HRTF panning.
The 3D audio options to set.
Throws an error if the sound has been cleaned up or if HRTF panning is not used.
Gets the current volume of the audio.
The current volume.
Throws an error if the sound has been cleaned up.
Sets the volume of the audio.
The volume to set.
Throws an error if the sound has been cleaned up.
Optional destination: AudioParam | AudioNodeFades in from silence to the current volume.
The fade duration in milliseconds.
Optional type: FadeTypeThe fade curve type. Defaults to "linear".
Resolves when the fade completes.
Fades out from the current volume to silence.
The fade duration in milliseconds.
Optional type: FadeTypeThe fade curve type. Defaults to "linear".
Resolves when the fade completes.
Fades the volume to a target value, emitting fadeStart and fadeEnd events.
Remove event listener.
Register event listener.
Cleanup function
Private refresh
Whether a fade is currently in progress.