title: Streaming audio buffer from a web page to C# Google Cloud Speech to Text SDK and receiving 400 errors
body: <p>I have a requirement to add speech-to-text from a web page.  I cannot find enough documentation to tell me what the best approach would be.  I have read posts and reviewed samples <a href="https://cloud.google.com/speech-to-text/docs/streaming-recognize" rel="nofollow noreferrer">Stream Audio from C#</a>.</p>
  
  <p><strong>UPDATE:</strong> <em>I have converted to WAV format on the client before sending to the server.  The result is a file that is recognized as WAV with no output.</em></p>
  
  <p><strong>UPDATE[20181004]:</strong> <em>I can successfully send record and save a full WAV file and then send it to Google Speech API <code>branch_Record-in-browser-before-sending-all</code>.  The branch also includes code that successfully sends chunks of WAV data to the server but Google Speech API does not return results for these audio parts</em></p>
  
  <p><strong>UPDATE[20181005]:</strong> <em>Attempted to use a ConcurrentQueue to implement streaming without success.  Moved the latest code to the <code>develop</code> branch and set it as default.</em></p>
  
  <p><strong>UPDATE[20181012]</strong> <em>Tried to copy and convert code from <code>https://github.com/googlecodelabs/speaking-with-a-webpage</code></em></p>
  
  <p>My approach: <a href="https://github.com/jacodv/GoogleSTT" rel="nofollow noreferrer">Sample AspnetCore Source + WebPage</a></p>
  
  <p>I am recording the audio from the microphone and sending the buffer over web sockets to the AspNetCore web application.  In the web application, I tried to buffer the data and post chunks of 32k.  The local buffer code was introduced to see if that would fix the 400 errors.</p>
  
  <p>The code is working up to sending the data to Google Speech API.  In the Google console, I can see 100% of my "WriteAsync" calls returned a 400 error, but I have no idea where to get the detail.  I am also not receiving any responses from the API allowing me to print the error detail.</p>
  
  <p><em>I presume the data being sent to the speech API is either an incorrect format or size.</em> </p>
  
  <p><strong>[20181004] Removed outdated code snippets</strong></p>