OfflineAudioContext: complete event

complete当离线音频上下文的呈现完成时,将触发OfflineAudioContext接口的事件。

泡泡 没有
取消 没有
默认操作 没有
接口 OfflineAudioCompletionEvent (en-US)
事件处理程序属性 OfflineAudioContext.oncomplete (en-US)

例子

处理完成后,你可能希望使用oncomplete处理程序提示用户现在可以播放音频,并启用播放按钮:

js
offlineAudioCtx.addEventListener("complete", () => {
  console.log("Offline audio processing now complete");
  showModalDialog("Song processed and ready to play");
  playBtn.disabled = false;
});

You can also set up the event handler using the OfflineAudioContext.oncomplete (en-US) property:

js
offlineAudioCtx.oncomplete = function () {
  console.log("Offline audio processing now complete");
  showModalDialog("Song processed and ready to play");
  playBtn.disabled = false;
};

Specifications

Specification
Web Audio API
# OfflineAudioCompletionEvent
Web Audio API
# dom-offlineaudiocontext-oncomplete

Browser compatibility

BCD tables only load in the browser

See also