我想使用振盪器應用音調顫音到AudioBufferSource。WebAudio:振盪AudioBufferSource playbackRate
var source = context.createBufferSource();
source.connect(context.destination);
source.buffer = buffer;
source.loop = true;
source.start(0);
// None of the below seems to have any effect in Chrome
var osc = context.createOscillator();
osc.type = "sine";
osc.frequency.value = 0.5;
osc.start(0);
var osc_gain = context.createGain();
osc_gain.connect(source.playbackRate);
osc.connect(osc_gain);
// osc_gain.gain.value = 0.1 doesn't work
osc_gain.gain.setValueAtTime(0.1, 0);
這是小提琴。 http://jsfiddle.net/HRkcE/12/
振盪器在Chrome中似乎沒有任何效果,但在Firefox中工作(一旦我發現設置osc_gain.gain.value直接不起作用)。
我做錯了什麼使它無法在Chrome中工作嗎?
非常感謝! –