Not sure if there's a better group to ask about WebAudio stuff specifically. Is there a way to keep WebAudio from "popping" when I start/stop an oscillator or change gain? The WebAudio spec claims that changes in gain should be dezippered to avoid popping, but that doesn't seem to happen in practice. e.g. this kind of script is popping a lot for me on mac:

var gAudio = new AudioContext();
var gGain = gAudio.createGain();
gGain.gain.value = 0;
gGain.connect(gAudio.destination);
var gOscillator = gAudio.createOscillator();
gOscillator.frequency.value = 256;
gOscillator.connect(gGain);
gOscillator.start(0);

function toggleGain()
{
  if (gGain.gain.value == 0) {
    gGain.gain.value = 1;
  }
  else {
    gGain.gain.value = 0;
  }
}
setInterval(toggleGain, 400);

Also, is there a minimum frequency for an oscillator? It seems like I don't get any audible output for sine-wafe frequencies below 115 or so and square-wave frequencies below 55 or so, when both piano and human hearing go down to 25hz or so.

--BDS


_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to