title: HTML5 record audio to file
body: <p>What I ultimately want to do is record from the user's microphone, and upload the file to the server when they're done. So far, I've managed to make a stream to an  element with the following code:</p>
  
  <pre><code>var audio = document.getElementById("audio_preview");
  
  navigator.getUserMedia  = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
  navigator.getUserMedia({video: false, audio: true}, function(stream) {
     audio.src = window.URL.createObjectURL(stream);
  }, onRecordFail);
  
  var onRecordFail = function (e) {
     console.log(e);
  }
  </code></pre>
  
  <p>How do I go from that, to recording to a file?</p>