是否可以将事件侦听器添加到网络音频 api 声音?我一直在寻找声音完成但找不到任何东西的事件或触发器。这是我想象它的工作方式:
soundSource = context.createBufferSource();
soundBuffer = context.createBuffer(audioData, true);
soundSource.buffer = soundBuffer;
soundSource.connect(volumeNode);
soundSource.addEventListener('ended', function(e){
console.log("ended", "", e);
}, false);
soundSource.noteOn(context.currentTime);