title: How to use google speech API for audio having 2 channels
body: <p>We have audio recordings with 2 people speaking on different channels. I am trying the official documentation for node.js <a href="https://github.com/GoogleCloudPlatform/nodejs-docs-samples" rel="nofollow noreferrer">here</a>. First of all, I got an error that the payload size was exceeding the maximum limit.</p>
  
  <pre><code>ubuntu@ip-xxxx:~/nodejs-docs-samples/speech$ node recognize.js async /home/ubuntu/output.wav
  (node:18306) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Request payload size exceeds the limit: 10485760 bytes.
  </code></pre>
  
  <p>The documentation however, has just mentioned the limits in terms of recording length and not in terms of the file size. Here is the <a href="https://cloud.google.com/speech/limits" rel="nofollow noreferrer">link</a></p>
  
  <p>Is there any workaround for this ?</p>
  
  <p>Also, I tried with a smaller file size and got the configuration error:</p>
  
  <pre><code>ubuntu@ip-xxx:~/nodejs-docs-samples/speech$ node recognize.js async /home/ubuntu/output2.wav
  (node:18291) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Invalid Configuration, Does not match Wav File Header.
  Wav Header Contents:
  Encoding: LINEAR16
  Channels: 2
  Sample Rate: 16000.
  Request Contents:
  Encoding: linear16
  Channels: 1
  Sample Rate: 16000.
  </code></pre>
  
  <p>I am not sure if the API allows usage of 2 channel audio input since I could not find any such config in the documentation. However, I found <a href="https://cloud.google.com/speech/docs/best-practices" rel="nofollow noreferrer">this link</a> where it is suggested to split the audio to individual channels and use them separately. What is the recommended way of doing this programmatically ?</p>