Optional_cacophony: CacophonyOptionalpreparedMediaElement: HTMLAudioElementOptional_preparedMediaElementCleanup: () => voidOptionalregion: Readonly<SpriteRegion>
Immutable atlas bounds for a region-backed Sound.
OptionalspriteName: string
Original sprite key, retained by clones for attribution.
Protected_Primary route target. null is the canonical master route.
Protected_Additional send target to gain-value mappings.
OptionalbufferProtectedglobalOptional ReadonlyregionImmutable atlas bounds for a region-backed Sound.
Optional ReadonlyspriteOriginal sprite key, retained by clones for attribution.
OptionalstreamRetrieves the duration of the sound in seconds. If the sound is based on an AudioBuffer, it returns the duration of the buffer. Otherwise, if the sound has not been played and is a MediaElementSource, it returns NaN, indicating that the duration is unknown or not applicable.
The duration of the sound in seconds.
Current pitch-shift factor (1 = no shift). See setPitchShift.
Called by Bus.drainTo to move this source off the draining bus
onto target. The source reroutes its primary route and/or any send that
targeted bus.
Protected_Materialize all declared recipes, then establish this playback's sends.
Resolve the node used by future playbacks for their primary output. Sources left on a subsequently destroyed bus fall back to master.
Protected_Establish every configured send on a newly created playback.
Clones the current Sound instance, creating a deep copy with the option to override specific properties.
This method allows for the creation of a new, independent Sound instance based on the current one, with the
flexibility to modify certain attributes through the overrides parameter. This is particularly useful for
creating variations of a sound without affecting the original instance. The cloned instance includes all properties,
playback settings, and filters of the original, unless explicitly overridden.
An object specifying properties to override in the cloned instance. This can include audio settings like volume, playback rate, and spatial positioning, as well as more complex configurations like 3D audio options and filter adjustments.
ProtectedemitProtectedemitOptionaltype: FadeTypeOptionaltype: FadeTypeOptionaltype: FadeTypeSets or retrieves the loop behavior for the sound. If loopCount is provided, the sound will loop the specified number of times. If loopCount is 'infinite', the sound will loop indefinitely until stopped. If no argument is provided, the method returns the current loop count setting.
OptionalloopCount: LoopCount
The number of times to loop or 'infinite' for indefinite looping.
The current loop count setting if no argument is provided.
Remove event listener.
Register event listener.
Cleanup function
Optionaloptions: PlayOptionsGenerates a Playback instance for the sound without starting playback. This allows for pre-configuration of playback properties such as volume and position before the sound is actually played.
Removes a BiquadFilterNode from the filter chain by object identity.
Routes a media-loader failure through the Sound's existing typed event system. Used by optional media transports after the Sound has loaded.
Route this source to a bus, or add an independent send when sendGain
is provided.
OptionalsendGain: numberSeeks to a specific time within the sound's playback.
The time in seconds to seek to.
This method iterates through all active Playback instances and calls their seek() method with the specified time.
Pitch-shifts every live playback of this Sound, resurrecting the dormant
phase-vocoder worklet (Jean Laroche & Mark Dolson, 1999 IEEE WASPAA —
peak-based pitch shift with Identity Phase-Locking). Mirrors how
playbackRate fans a per-playback control out across this.playbacks.
The factor is also stored so future playbacks pick it up at preplay.
Pitch multiplier (> 0; 2 = +1 octave, 0.5 = -1 octave).
Resolves once every live playback's worklet node has been built
and its pitchFactor param updated.
Optionaltype: FadeTypeOFFLINE independent time-stretch: produce a NEW buffer-based Sound whose
tempo is changed by factor WITHOUT changing pitch (Phase Gradient Heap
Integration, Průša & Holighaus, "Phase Vocoder Done Right", EUSIPCO 2017 /
arXiv:2202.07382). factor > 1 is slower/longer, factor < 1 is
faster/shorter. Only valid for buffer-based sounds (a loaded AudioBuffer);
streaming / media-element sounds have no decoded buffer to transform.
The original Sound is left untouched; a fresh Sound wrapping the stretched buffer is returned. Delegates to Cacophony.timeStretchBuffer.
Stretch factor (> 0); pitch is preserved.
Optionaloptions: TimeStretchOptions
Optional PGHI parameters (fftSize, analysisHop, tol, seed).
A new buffer-based Sound at the stretched tempo.
The base interface for any sound-producing entity, including individual sounds, groups, and playbacks. BaseSound