Optional _cacophony: CacophonyPrivate Optional _cacophonyCanonical 3D-audio configuration storage. Always holds a fully-populated
HRTF variant (ThreeDOptions with panType: "HRTF") so callers
reading via the getter never see undefined fields. Setting the stereo
variant replaces this with the stereo shape (no stale HRTF fields).
Private contextPrivate globalPrivate panPrivate primePrivate stopPrivate streamReturns a boolean indicating whether the object is currently playing. an object is playing if any of its playbacks are currently playing.
Retrieves the current 3D spatial position of the sound in the audio context. The position is returned as an array of three values[x, y, z].
Sets the 3D spatial position of the sound in the audio context. The position is an array of three values[x, y, z]. This method updates the position of all active playbacks of the sound.
Returns a fresh copy of the canonical 3D-audio configuration. The clone
prevents callers from mutating the container's internal state via the
returned reference (previously the raw _threeDOptions object leaked).
Accepts either a full canonical ThreeDOptions value, or a partial
HRTF-options override (legacy ergonomics). When a partial is provided the
existing variant is merged in place — and if the existing variant is
stereo, the partial is interpreted as a switch back to HRTF defaults plus
the override (no stale stereo fields). When a full variant is provided
with a different panType, the storage is replaced wholesale so stale
fields from the previous variant cannot be observed via the getter.
Gets the volume of the sound. This volume level affects all current and future playbacks of this sound instance. The volume is specified as a linear value between 0 (silent) and 1 (full volume).
Sets the volume of the sound. This volume level affects all current and future playbacks of this sound instance. The volume is specified as a linear value between 0 (silent) and 1 (full volume).
Adds a BiquadFilterNode to the container's filter chain. Filters are cloned when creating new playbacks - existing playbacks are not affected. Each playback gets independent filter instances for isolated processing.
Private createFades in all playbacks from silence to their current volume.
The fade duration in milliseconds.
Optional type: FadeTypeThe fade curve type. Defaults to "linear".
Resolves when all fades complete.
Fades out all playbacks from their current volume to silence.
The fade duration in milliseconds.
Optional type: FadeTypeThe fade curve type. Defaults to "linear".
Resolves when all fades complete.
Fades the volume of all playbacks to a target value over a duration.
The target volume (0 to 1).
The fade duration in milliseconds.
Optional type: FadeTypeThe fade curve type. Defaults to "linear".
Resolves when all fades complete.
Starts playback of the sound and returns a Playback instance representing this particular playback. Multiple Playback instances can be created by calling this method multiple times, allowing for the same sound to be played concurrently with different settings.
Removes a BiquadFilterNode from the container's filter chain. Only affects future playbacks - existing playbacks retain their cloned filters.
If the filter was never added to this container.
Fades out all playbacks then stops them.
The fade-out duration in milliseconds.
Optional type: FadeTypeThe fade curve type. Defaults to "linear".
Resolves when the fade completes and all playbacks are stopped.
The base interface for any sound-producing entity, including individual sounds, groups, and playbacks. BaseSound