Getting contents of a streaming Blob to be sent to a Node.js Server

I already have a working page that uses the microphone to stream data to an <audio> tag.

However, I want the data sent to my <audio> 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.)

This is the code that I have luckily. :)

<audio src="" id="audio" controls="controls">Sad twinkletoes does not have audio.</audio><br>
<br>
<span id="aw"></span>
<script>

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 = '<code>Streaming...</code>';
                    // 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);
}

</script>

https://github.com/muaz-khan/WebRTC-Experiment/tree/master/RTCMultiConnection

Thats probably the way to go. Not saying you have to use that specific library, but webrtc is definitely how you're going to want to mess around with streaming audio (or video) from a users local device to someone else. You'd think it'd be easy to get the audio stream from an audio element but it turns out its pretty tricky.

The above library has hooks for node and socket.io, although it uses firebase for session initiation/handshake by default.