feedback loop seems to crash panner node.

Hello,

I was trying to get a feedback loop (gain->delay->gain) connected to a pannernode, but this resulted in an instant crash. The crash occurs in both Safari and Chrome. First I thought web audio perhaps didn't allow feedback, but without the panner, everything works charming.

I found a workaround by making my own panner (using a merger) but still I wonder why the panner doesn't like feedback loops.

Anybody has an idea ?



This is a simplified example to show the crash:

window.AudioContext = (
    window.AudioContext ||
    window.webkitAudioContext ||
    null
  );

  if (!AudioContext) {
    throw new Error("AudioContext not supported!");
  } 

  // this is a patch to show that panner can crash your browser.

  var context = new AudioContext();

  var sinosc = context.createOscillator();
  var gain = context.createGainNode();
  var delay = context.createDelayNode(5);
  var feedbackgain = context.createGainNode();
  var panner = context.createPanner();

  sinosc.connect(delay);
  delay.connect(feedbackgain);
  feedbackgain.connect(delay);
  delay.connect(panner);
  panner.connect(context.destination); // this is the line that generates the crash.
  //note: removing the feedback loop also seems to fix the issue.

  panner.setPosition(5,0.1,0.1);
  sinosc.connect(panner);
  
  sinosc.frequency.value = 440;
  sinosc.noteOn(0);

Received on Thursday, 3 October 2013 20:15:04 UTC