title: Connect Browser Microphone stream to Google Speech Api via node
body: <p>I just started with node.js and am trying to connect the generated microphone stream from the browser with the google speech api running on my node server and the <code>microphone-stream</code> package.</p>
  
  <p>I successfully packed the necessary modules with browserify, but now don't know how to proceed. I got the microphone stream to work on the <code>node server</code> as well (as explained here: <a href="https://cloud.google.com/speech/docs/streaming-recognize" rel="nofollow noreferrer">Streaming Speech Recognition on an Audio Stream</a> ).</p>
  
  <p>How can I transmit the audiostream? I read about using websockets in one issue, but didn't really understand if it's the right way in my case. Or RPC?</p>
  
  <p>For now I'm using these packages on the server:</p>
  
  <pre><code>const express = require('express');
  const path = require('path');
  const bodyParser = require('body-parser');
  const fs = require('fs');
  const record = require('node-record-lpcm16');
  const google = require('googleapis');
  const getUserMedia = require('get-user-media-promise');
  const MicrophoneStream = require('microphone-stream');
  </code></pre>
  
  <p>This is my first time using node / a server, so hopefully this question isn't too naive.
  Thanks! :)</p>