Record audio, and then save as a wav file. This is an (almost) exact replica of AudioRecorder: http://webaudiodemos.appspot.com/.