title: Differences in WAV format (JS / NodeJS)
body: <p>I'm trying to use WebRTC to record audio and then store it on the server side. My server is made using NodeJS and express, and I'm using POST to transmit the data from the client to the server.</p>
  
  <p>On the client I'm translating the data from the wav BLOB to base64, transfer that, and on the server side, read it, translate it to binary, and then write it in a file. Should be fine, right?</p>
  
  <p>There's just one problem : I'm getting some really bad inconsistencies between what you can download from the client, and what gets sent to the server. Sometimes it's added bytes, other times it's just deleted chunks of data. If it were just bytes added, that would mean a charset problem (translating from one to another, and then another, etc), but at some points I had 280 bytes added for example.</p>
  
  <p>I've added a picture here of a hex diff :
  <a href="http://i.stack.imgur.com/psqf4.png" rel="nofollow">http://i.stack.imgur.com/psqf4.png</a> (sorry, I don't have enough reputation so far to post an image directly)</p>
  
  <p>Also, running file with these gives me the following : 
  (uuid.wav is the server one, while output (1).wav is the client one)</p>
  
  <p><code>9F2B75D3-4C34-4C8F-935E-FC7637D7A054.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 4 bit, stereo 11321924 Hz</code></p>
  
  <p><code>output (1).wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz</code></p>
  
  <p>... so clearly something is going wrong here. Also, trying to fix the headers, or convert the WAV gives me an error that goes along the lines of : could not find data chunk / data chunk has size 0.</p>
  
  <p>Any ideas what might be causing this?</p>