There is a fairly complete recording demo available at: http://webaudiodemos.appspot.com/AudioRecorder/index.html
It allows you to record audio in the browser, then gives you the option to export and download what you’ve recorded.
You can view the source of that page to find links to the javascript, but to summarize, there’s a Recorder
object that contains an exportWAV
method, and a forceDownload
method.