1
我試圖調製saw
頻率與來自慢振盪器sine
的脈衝。我究竟做錯了什麼? jsFiddle here:https://jsfiddle.net/06ua9zLo/WebAudio FM調製
window.AudioContext = window.AudioContext||window.webkitAudioContext;
var context = new AudioContext();
var saw = context.createOscillator(),
sine = context.createOscillator(),
sineGain = context.createGain();
//set up our oscillator types
saw.type = 'sawtooth';
sine.type = 'sine';
//set the amplitude of the modulation
sineGain.gain.value = 10;
//connect the dots
sine.connect(sineGain);
sineGain.connect(saw.frequency);
saw.connect(context.destination);
sine.start();
saw.start();
準確地說 - 您必須記住每個點的範圍。振盪器從-1變爲1,但只有+/- 1Hz的頻率變化可能沒有多大區別。 – cwilso