An AudioContext can be a target of events, therefore it implements the EventTarget interface.

Documentation AudioContext by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Constructor

new (audioChannelType:AudioChannel)

new ()

Throws:

null

DOMError

Variables

read onlycurrentTime:Float

Returns a double representing an ever-increasing hardware time in seconds used for scheduling. It starts at 0.

read onlydestination:AudioDestinationNode

Returns an AudioDestinationNode representing the final destination of all audio in the context. It can be thought of as the audio-rendering device.

read onlylistener:AudioListener

Returns the AudioListener object, used for 3D spatialization.

onstatechange:Function

An event handler that runs when an event of type statechange has fired. This occurs when the AudioContext's state changes, due to the calling of one of the state change methods (AudioContext.suspend, AudioContext.resume, or AudioContext.close).

read onlysampleRate:Float

Returns a float representing the sample rate (in samples per second) used by all nodes in this context. The sample-rate of an AudioContext cannot be changed.

read onlystate:AudioContextState

Returns the current state of the AudioContext.

Methods

close ():Promise<Void>

Throws:

null

DOMError

createAnalyser ():AnalyserNode

Throws:

null

DOMError

createBiquadFilter ():BiquadFilterNode

Throws:

null

DOMError

createBuffer (numberOfChannels:Int, length:Int, sampleRate:Float):AudioBuffer

Throws:

null

DOMError

createChannelMerger (numberOfInputs:Int = 6):ChannelMergerNode

Throws:

null

DOMError

createChannelSplitter (numberOfOutputs:Int = 6):ChannelSplitterNode

Throws:

null

DOMError

createConvolver ():ConvolverNode

Throws:

null

DOMError

createDelay (maxDelayTime:Float = 1.0):DelayNode

Throws:

null

DOMError

createGain ():GainNode

Throws:

null

DOMError

createOscillator ():OscillatorNode

Throws:

null

DOMError

createPanner ():PannerNode

Throws:

null

DOMError

createScriptProcessor (bufferSize:Int = 0, numberOfInputChannels:Int = 2, numberOfOutputChannels:Int = 2):ScriptProcessorNode

Throws:

null

DOMError

createStereoPanner ():StereoPannerNode

Throws:

null

DOMError

createWaveShaper ():WaveShaperNode

Throws:

null

DOMError

decodeAudioData (audioData:ArrayBuffer, ?successCallback:AudioBuffer ‑> Void, ?errorCallback:Void ‑> Void):Promise<AudioBuffer>

Throws:

null

DOMError

resume ():Promise<Void>

Throws:

null

DOMError

suspend ():Promise<Void>

Throws:

null

DOMError

Inherited Variables

Inherited Methods

Defined by EventTarget

addEventListener (type:String, listener:Function, capture:Bool = false):Void

addEventListener (type:String, listener:EventListener, capture:Bool = false, ?wantsUntrusted:Bool):Void

Throws:

null

DOMError

dispatchEvent (event:Event):Bool

Throws:

null

DOMError

removeEventListener (type:String, listener:Function, capture:Bool = false):Void

removeEventListener (type:String, listener:EventListener, capture:Bool = false):Void

Throws:

null

DOMError