web api event
OfflineAudioContext: complete event
The complete event of the OfflineAudioContext interface is fired when the rendering of an offline audio context is complete.
This event is not cancelable and does not bubble.
Syntax
Use the event name in methods like addEventListener(), or set an event handler property.
addEventListener("complete", (event) => { })
oncomplete = (event) => { }
Event type
An OfflineAudioCompletionEvent. Inherits from Event.
Examples
When processing is complete, you might want to use the complete event handler to prompt the user that the audio can now be played, and enable the play button:
const offlineAudioCtx = new OfflineAudioContext();
offlineAudioCtx.addEventListener("complete", () => {
console.log("Offline audio processing now complete");
alert("Song processed and ready to play");
playBtn.disabled = false;
});
You can also set up the event handler using the oncomplete property:
const offlineAudioCtx = new OfflineAudioContext();
offlineAudioCtx.oncomplete = () => {
console.log("Offline audio processing now complete");
alert("Song processed and ready to play");
playBtn.disabled = false;
};
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.