The numeric identifier for accessing this node
The audio source path
The AudioContainer which controls playback
The time in seconds at which playback was started
The time in seconds at which playback was paused
Registered event callbacks
If this Sound source is currently in the process of loading, this attribute contains a Promise that will resolve when the loading process completes.
The registered event handler id for this Sound. Incremented each time a callback is registered.
A collection of scheduled events recorded as window timeout IDs
A global audio node ID used to quickly reference a specific audio node
A convenience reference to the sound context used by the application
A reference to the audio source node being used by the AudioContainer
A reference to the GainNode parameter which controls volume
The current playback time of the sound
The total sound duration, in seconds
Is the contained audio node loaded and ready for playback?
Did the contained audio node fail to load?
Is the audio source currently playing?
Is the Sound current looping?
Is the Sound current looping?
The volume at which the Sound is playing
The volume at which the Sound is playing
Fade the volume for this sound between its current level and a desired target volume
The desired target volume level between 0 and 1
Additional options that configure the fade operation
A Promise that resolves after the requested fade duration
Load the audio source, creating an AudioBuffer. Audio loading is idempotent, it can be requested multiple times but only the first load request will be honored.
Additional options which affect resource loading
The Sound once its source audio buffer is loaded
Begin playback for the sound node
Options which configure playback
Pause playback, remembering the playback position in order to resume later.
Stop playback, fully resetting the Sound to a non-playing state.
Schedule a function to occur at the next occurrence of a specific playbackTime for this Sound.
A function that will be called with this Sound as its single argument
The desired playback time at which the function should be called
A Promise which resolves once the scheduled function has been called
Trigger registered callback functions for a specific event name.
The event name being emitted
Deactivate an event handler which was previously registered for a specific event
The event name being deactivated
The callback ID or callback function being un-registered
Register an event handler to take actions for a certain Sound event.
The event name being deactivated
The callback function to trigger when the event occurs
Additional options that affect callback registration
Called when playback concludes naturally
Called when the audio buffer is first loaded
Called when playback is paused
Called when the sound begins playing
Called when playback is stopped (prior to naturally reaching the end)
Register a new callback function for a certain event. For internal use only.
Cancel all pending scheduled events.
The Sound class is used to control the playback of audio sources using the Web Audio API.