Revision Content

{{WebAudioRef}} {{SeeCompatTable}}

The OfflineAudioContext interface is an {{domxref("AudioContext")}} that is an interface representing an audio-processing graph built from {{domxref("AudioNode")}} linked together. In contrast with a basic {{domxref("AudioContect")}}, an OfflineAudioContext doesn't really render the audio but generates it, as fast as it can, in a buffer.

An OfflineAudioContext is a regular AudioContext and therefore can be target of events, therefore it implements the {{domxref("EventTarget")}} interface.

Properties

Also implements properties from its parents {{domxref("AudioContext")}}.

{{domxref("OfflineAudioContext.oncomplete")}}

Is an {{domxref("EventHandler")}} called when the processing is terminated, that is when the event {{event("complete")}} of type {{domxref("OfflineAudioCompletionEvent")}} is raised.

Methods

Also implements methods from its parent {{domxref("AudioContext")}}, and therefore of {{domxref("EventTarget")}}.

{{domxref("OfflineAudioContext.startRendering()")}}

Starts rendering the audio, taking into account the current connections and the current scheduled changes. The event {{event("completed")}} of type {{domxref("OfflineAudioCompletionEvent")}}, and containing the resulting buffer, is raised when the rendering is finished