title: Stream live audio to Node.js server
body: <p>I'm working on a project and I require to send an audio stream to a Node.js server. I'm able to capture microphone sound with this function:</p>
  
  <pre><code>function micCapture(){
      'use strict';
  
      navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
  
      var constraints = {
          audio: true,
          video: false
      };
  
      var video = document.querySelector('video');
  
      function successCallback(stream) {
          window.stream = stream; // stream available to console
          if (window.URL) {
              video.src = window.webkitURL.createObjectURL(stream);
          } else {
              video.src = stream;
          }
          //Send audio stream
          //server.send(stream);
      }
  
      function errorCallback(error) {
          console.log('navigator.getUserMedia error: ', error);
      }
  
      navigator.getUserMedia(constraints, successCallback, errorCallback);
  }
  </code></pre>
  
  <p>As you can see, I'm able to capture audio and play it on the website.</p>
  
  <p>Now I want to send that audio stream to a Node.js server, and send it back to other clients. Like a voicechat, but I don't want to use WebRTC as I need the stream in the server. How can I achieve this? Can I use socket.io-stream to do this? In the examples I saw, they recorded the audio, and sent a file, but I need "live" audio.</p>