title: Web Audio Offline Context and Analyser Node
body: <p>Is it possible to use the <code>Analyser</code> node in the <code>offlineAudioContext</code> to do frequency analysis?</p>
  
  <p>I found out that <code>ScriptProcessor</code> 's <code>onaudioprocess</code> event still fires in the <code>offlineAudioContext</code> and this was the only event source I could use to call <code>getByteFrequencyData</code> of the <code>Analyser</code> Node. As below:</p>
  
  <pre><code>var offline = new offlineAudioContext(1, buffer.length, 44100);
  var bufferSource = offline.createBufferSource();
  bufferSource.buffer = buffer;
  
  var analyser = offline.createAnalyser();
  var scp = offline.createScriptProcessor(256, 0, 1);
  
  bufferSource.connect(analyser);
  scp.connect(offline.destination); // this is necessary for the script processor to start
  
  var freqData = new Uint8Array(analyser.frequencyBinCount);
  scp.onaudioprocess = function(){
      analyser.getByteFrequencyData(freqData);
      console.log(freqData);
     // freqData is always the same.
  };
  
  bufferSource.start(0);
  offline.startRendering();
  </code></pre>
  
  <p>The problem here is that <code>freqData</code> array is always the same and never changes. Seem like as if it is only analysing one section of the buffer.</p>
  
  <p>Am I doing anything wrong here? Or the <code>Analyser</code> is not intended to be used in the <code>offlineContext</code>.</p>
  
  <p>And here is the <a href="http://jsfiddle.net/ehsanziya/7fouhvfo/4/" rel="nofollow">fiddle</a> with the same code.</p>