Whether to start playback automatically. Default is false.
The AudioContext of the listener given in the constructor.
Modify pitch, measured in cents. +/- 100 is a semitone. +/- 1200 is an octave. Default is 0.
Overrides the duration of the audio. Same as the duration parameter of AudioBufferSourceNode.start(). Default is undefined to play the whole buffer.
Represents an array of BiquadFilterNodes. Can be used to apply a variety of low-order filters to create more complex sound effects. Filters are set via Audio.setFilter or Audio.setFilters.
A GainNode created using AudioContext.createGain().
Whether playback can be controlled using the play(), pause() etc. methods. Default is true.
Whether the audio is currently playing.
A reference to the listener object of this audio.
An offset to the time within the audio buffer that playback should begin. Same as the offset parameter of AudioBufferSourceNode.start(). Default is 0.
Speed of playback. Default is 1.
An AudioBufferSourceNode created using AudioContext.createBufferSource().
Type of the audio source. Default is string 'empty'.
String denoting the type, set to 'Audio'.
Connect to the Audio.source. This is used internally on initialisation and when setting / removing filters.
Disconnect from the Audio.source. This is used internally when setting / removing filters.
Returns the first element of the filters array.
Returns the filters array.
Return the value of source.loop (whether playback should loop).
Return the gainNode.
Return the value of playbackRate.
Return the current volume.
Called automatically when playback finished.
If hasPlaybackControl is true, pauses playback.
If hasPlaybackControl is true, starts playback.
Setup the source to the audioBuffer, and sets sourceType to 'buffer'. If autoplay, also starts playback.
Applies a single BiquadFilterNode to the audio.
value - arrays of filters. Applies an array of BiquadFilterNodes to the audio.
Set source.loop to value (whether playback should loop).
Set source.loopEnd to value.
Set source.loopStart to value.
Applies the given object of type HTMLMediaElement as the source of this audio. Also sets hasPlaybackControl to false.
Applies the given object of type MediaStream as the source of this audio. Also sets hasPlaybackControl to false.
Setup the source to the audioBuffer, and sets sourceType to 'audioNode'. Also sets hasPlaybackControl to false.
If hasPlaybackControl is enabled, set the playbackRate to value.
Set the volume.
If hasPlaybackControl is enabled, stops playback.
Generated using TypeDoc
Create a audio object. This uses the Web Audio API.