【发布时间】:2012-03-15 10:11:31
【问题描述】:
我应该能够使用同一个AudioBufferSourceNode 多次播放声音吗?出于某种原因,第二次调用 noteGrainOn 不会播放音频,即使有介入的 noteOff。
这段代码只播放一次声音:
var node = audioContext.createBufferSource()
node.buffer = audioBuffer
node.connect(audioContext.destination)
var now = audioContext.currentTime
node.noteGrainOn(now, 0, 2)
node.noteOff(now + 2)
node.noteGrainOn(now + 3, 0, 2)
node.noteOff(now + 5)
【问题讨论】: