An AudioSourceNode container which handles the strategy of node type to use for playback. Used by the Sound interface which controls playback. This class is for internal use only and should not be used by external callers.
The audio source path
The Audio Node used to control this sound
The GainNode used to control volume
Is this container using an AudioBuffer?
Whether we have attempted to load the audio node or not, and whether it failed.
Is the audio source currently playing?
Should the audio source loop?
The maximum duration, in seconds, for which an AudioBuffer will be used. Otherwise, a streaming media element will be used.
The sequence of container loading states.
Has the audio file been loaded either fully or for streaming.
Did the audio file fail to load.
A reference to the AudioBuffer if the sourceNode is a AudioBufferSourceNode.
The game audio context used throughout the application.
The total duration of the audio source in seconds
A reference to the HTMLMediaElement, if the sourceNode is a MediaElementAudioSourceNode.
Load the source node required for playback of this audio source
Create an Audio source node using a buffered array.
The source URL from which to create the buffer
The created and decoded buffer
Begin playback for the source node.
Terminate playback for the source node.
Create the initial audio node used for playback. Determine the node type to use based on cached state and sound duration.
Create a AudioBufferSourceNode using a provided AudioBuffer
Create an HTML5 Audio element which has loaded the metadata for the provided source.
Create a MediaElementAudioSourceNode using a provided HTMLAudioElement
Perform cleanup actions when the sound has finished playing. For MediaElementAudioSourceNodes, this also means optionally restarting if the sound is supposed to loop.
A callback provided by the owner of the container that gets fired when the sound ends.
Unload the MediaElementAudioSourceNode to terminate any ongoing connections.