Web Audio API
complete当离线音频上下文的呈现完成时,将触发OfflineAudioContext接口的事件。
<table class="properties"> <tbody> <tr> <th scope="row">泡泡</th> <td>没有</td> </tr> <tr> <th scope="row">取消</th> <td>没有</td> </tr> <tr> <th scope="row">默认操作</th> <td>没有</td> </tr> <tr> <th scope="row">接口</th> <td>OfflineAudioCompletionEvent</td> </tr> <tr> <th scope="row">事件处理程序属性</th> <td>OfflineAudioContext.oncomplete</td> </tr> </tbody> </table>
例子
处理完成后,你可能希望使用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 property:
offlineAudioCtx.oncomplete = function () {
console.log("Offline audio processing now complete");
showModalDialog("Song processed and ready to play");
playBtn.disabled = false;
};
Specifications
Browser compatibility
See also
- 离线音频上下文.oncomplete
- Web Audio API
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
