title: HTML5 Audio recording too large
body: <p>I managed to create a complete recorder using HTML5.
  My problem is the <strong>size of the WAV file</strong> created, it's too large to be sent to my servers. I'm using the <code>exportWAV</code> function alot of users seem to be using.
  This function creates a WAV file from the audio BLOB:</p>
  
  <pre><code>function encodeWAV(samples){
    var buffer = new ArrayBuffer(44 + samples.length * 2);
    var view = new DataView(buffer);
  
    writeString(view, 0, 'RIFF');
    view.setUint32(4, 32 + samples.length * 2, true);
    writeString(view, 8, 'WAVE');
    writeString(view, 12, 'fmt ');
    view.setUint32(16, 16, true);
    view.setUint16(20, 1, true);
    view.setUint16(22, 1, true);
    view.setUint32(24, sampleRate, true);
    view.setUint32(28, sampleRate * 4, true);
    view.setUint16(32, 4, true);
    view.setUint16(34, 16, true);
    writeString(view, 36, 'data');
    view.setUint32(40, samples.length * 2, true);
    floatTo16BitPCM(view, 44, samples);
  
    return view;
  }
  </code></pre>
  
  <p>I was browsing through the alternatives, but none of them are really sufficient or simple enough:</p>
  
  <ul>
  <li>Zipping the file - Doesn't work well and has some security issues.</li>
  <li>Converting to MP3 - Makes the process much slower and complicated, also has security issues, and causes the sound to lose alot of quality.</li>
  </ul>
  
  <p>My question is - Does the HTML5 getUserMedia export <strong>only to .WAV files</strong> ?
  If there was a function, like <code>encodeWAV</code> I used, which is <code>encodeMP3</code> - That would be <strong>perfect</strong>.</p>
  
  <p>What is the recommended way so solve such a problem?</p>
  
  <p>I'd love to get a simple working example if possible.</p>
  
  <p>Thanks.</p>