The OfflineAudioContext interface is an AudioContext interface representing an audio-processing graph built from linked together AudioNodes. In contrast with a standard AudioContext, an OfflineAudioContext doesn't render the audio to the device hardware; instead, it generates it, as fast as it can, and outputs the result to an AudioBuffer.

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

See:

Constructor

new (numberOfChannels:Int, length:Int, sampleRate:Float)

Throws:

null

DOMError

Variables

oncomplete:Function

Is an EventHandler called when processing is terminated, that is when the complete event (of type OfflineAudioCompletionEvent) is raised, after the event-based version of OfflineAudioContext.startRendering() is used.

Methods

startRendering ():Promise<AudioBuffer>

Throws:

null

DOMError

Inherited Variables

Defined by AudioContext

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.

Inherited Methods

Defined by AudioContext

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

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