ScriptProcessorNode behavior without JavsScript references

Let's say you create a ScriptProcessorNode and set the onaudioprocess to
generate, say, a sine wave.  Something like the script below.

In this case, all Javascript references to the ScriptProcessorNode and the
corresponding onaudioprocess function are dropped.

What should happen now?  Should you still hear the sine wave?

--
Ray

Sample code:

var MyClass = function () {
  var mAudioContext;

  var mPhase = 0;

  var generateTimeSlice = function (leftBuf, rightBuf) {
    var bufLen = leftBuf.length;
    for (var k = 0; k < bufLen; k++) {
      leftBuf[k] = Math.sin(mPhase);
      rightBuf[k] = Math.sin(mPhase * 1.01);
      mPhase += 0.02;
    }
  };

  this.init = function () {
    mAudioContext = new AudioContext();
    var scriptNode = mAudioContext.createScriptProcessor(4096, 0, 2);
    scriptNode.onaudioprocess = function (event) {
      var leftBuf = event.outputBuffer.getChannelData(0);
      var rightBuf = event.outputBuffer.getChannelData(1);
      generateTimeSlice(leftBuf, rightBuf);
    };

    scriptNode.connect(mAudioContext.destination);
  };
};

var gMyClass = new MyClass();
gMyClass.init();

Received on Tuesday, 17 September 2013 20:49:25 UTC