--- title: 'OfflineAudioContext: complete event' slug: Web/API/OfflineAudioContext/complete_event translation_of: Web/API/OfflineAudioContext/complete_event original_slug: Web/API/OfflineAudioContext/complete ---
{{DefaultAPISidebar("Web Audio API")}}
complete
当离线音频上下文的呈现完成时,将触发{{domxref("OfflineAudioContext")}}接口的事件。
泡泡 | 没有 |
---|---|
取消 | 没有 |
默认操作 | 没有 |
接口 | {{domxref( "OfflineAudioCompletionEvent")}} |
事件处理程序属性 | {{domxref( "OfflineAudioContext.oncomplete")}} |
处理完成后,您可能希望使用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 {{domxref("OfflineAudioContext.oncomplete")}} property:
offlineAudioCtx.oncomplete = function() { console.log('Offline audio processing now complete'); showModalDialog('Song processed and ready to play'); playBtn.disabled = false; }
Specification | Status | Comment |
---|---|---|
{{SpecName('Web Audio API', '#OfflineAudioCompletionEvent-section', 'OfflineAudioCompletionEvent')}} | {{Spec2('Web Audio API')}} |
{{Compat("api.OfflineAudioContext.complete_event")}}