如何使用此功能以dB为单位设置音量? 我还可以控制偏侧(R / L体积)吗?
function playNote1(frequency, duration) {
// create Oscillator node
var oscillator = audioCtx.createOscillator();
oscillator.type = 'square';
oscillator.frequency.value = frequency; // value in hertz
oscillator.connect(audioCtx.destination);
oscillator.start();
setTimeout(function(){oscillator.stop();}, duration);
}