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
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.
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.
Methods
createScriptProcessor (bufferSize:Int = 0, numberOfInputChannels:Int = 2, numberOfOutputChannels:Int = 2):ScriptProcessorNode
Throws:
null | DOMError |
---|
decodeAudioData (audioData:ArrayBuffer, ?successCallback:AudioBuffer ‑> Void, ?errorCallback:Void ‑> Void):Promise<AudioBuffer>
Throws:
null | DOMError |
---|