如何判断AudioBufferSourceNode是否已开始播放?

时间:2015-11-10 02:51:13

标签: web-audio

AudioBufferSourceNode摘录:

var myAudioBuffSrcNode = audioContext.createBufferSource();
// Schedules for playback, but doesn't guarantee that
// playback will start right away.
myAudioBuffSrcNode.start();

如何判断节点是否正在播放?所以可以这样做:

if ( isPlaying ) {
  myAudioBufferSrcNode.stop();
}

0 个答案:

没有答案