title: Getting contents of a streaming Blob to be sent to a Node.js Server
body: <p>I already have a working page that uses the microphone to stream data to an <code>&lt;audio&gt;</code> tag.</p>
  
  <p>However, I want the data sent to my <code>&lt;audio&gt;</code> tag to be harvested instead. How do you
  think can the data being streamed be harvested and continuously be streamed to a Node.js
  Server? (I am gonna use Binaryjs for the binary data streaming.)</p>
  
  <p>This is the code that I have luckily. :)</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;audio src="" id="audio" controls="controls"&gt;Sad twinkletoes does not have audio.&lt;/audio&gt;&lt;br&gt;
  &lt;br&gt;
  &lt;span id="aw"&gt;&lt;/span&gt;
  &lt;script&gt;
  
  try {
      navigator.getMedia = ( navigator.getUserMedia    || navigator.webkitGetUserMedia ||
                          navigator.mozGetUserMedia ||navigator.msGetUserMedia);
  
      navigator.getMedia ({
              audio: true
          },
          function(stream) {
              var audio = document.getElementById('audio');
              var streamer = window.URL.createObjectURL(stream);
              audio.src = streamer;
              var loopertime = 3;
              var looper = setInterval(function() {
                  if(loopertime == 0) {
                      clearInterval(looper);
                      audio.play();
                      // stream starts here!
                      var spanner = document.getElementById('aw');
                      spanner.innerHTML = '&lt;code&gt;Streaming...&lt;/code&gt;';
                      // this is where I want the data to be streamed...
  
  
                  } else {
                      audio.play();
                      setTimeout(function() {
                          audio.pause();
                      },10);
                      loopertime--; // played and paused 3 times... getaround for audio only not working
                  }
              },15);
          },
          function(err) {
              // No permissions
          }
      );
  }
  
  catch(e) {
      alert('Your browser does not support HTML5 Audio Media.');
      console.log(e);
  }
  
  &lt;/script&gt;
  </code></pre>