title: Web Audio API -- Capture Stream from Analyser
body: <p>The Web Audio API examples show a source stream going directly to an audio context destination node, like the speakers or canvas. I want to collect data from the analyser, and then render a React component with it. The best I came up with is to interval poll:</p>
  <pre><code>const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
  mediaRecorder = new MediaRecorder(stream);
  
  // start button click
  mediaRecorder.start();
  analyserPoll = setInterval(() =&gt; {
    analyser.getFloatTimeDomainData(buffer);
    collect = [...collect, buffer];
  }, 500);
  
  // stop button click
  mediaRecorder.stop();
  clearInterval(analyserPoll);
  </code></pre>
  <p>Is there a more official way of doing this inside the API without the setTimeout? For instance, saving to a Blob or file, and then running my analyser code on that? It's a McLeod pitch detector.</p>