OfflineAudioContext: complete event

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

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

例子

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

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:

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

Specifications

Specification Status Comment
Web Audio API
OfflineAudioCompletionEvent
Working Draft  

Browser compatibility

BCD tables only load in the browser

See also