TL;DR : here's a plugin to access the microphone via Flash, encode the WAV in MP3 or OGG, and it gives you back a base64 string that represent the audio file.
<img src="https://dl.dropbox.com/u/1412774/MicrophoneC2Demo2/demo.png" border="0">
In the HTML5 draft, the browsers vendors are planning the use of the Microphone device.
On some systems and builds, you can even use it in conjunction with the webcam via getUserMedia(). However, there's no build anywhere to use the Local Stream Media to grab the audio from the microphone, and inject it inside an <audio> tag. Even if that code would exist, there's no realistic way to compress that audo in MP3 or OGG in Javascript for the moment.
However, we can hope that in two or three years from now, that the HTML5 spec would be advanced enough to allow that.
For the moment, here's a plugin that uses a Flash fallback to grab the Mic, and compress the WAV to MP3 and OGG.
Once that audio is recorded, you can insert it as a base64 string with the Base64 Audio plugin : http://www.scirra.com/forum/plugin-base64-audio_topic52192_post328265.html#328265.
The OGG encoder is modded to avoid a full memory clear and reload between each encoding, the MP3 encoder still need to reload itself between each encoding. That means the MP3 encoding part is usually faster than the OGG encoding on the first encoding, but it's slower on the following encoding.
I need to change the Shine encoder, however the change is heavier, because I need to have a proper Alchemy-encoding gcc installed, and it's not simple...
To do its job, the Flash part of the plugin display a Security Panel to allow the access to the microphone. That panel is shown and hidden when you need it. (On the HTML side, to hide the panel, I just set the width & height to 1 pixel, because a truly hidden div with a Flash inside won't execute any Flash if it's hidden). To avoid the "dead pixel" effect of that 1 pixel wide div when you want it hidden, you can set the color background of that div, to let it better blend inside your game.
Since I didn't have the time to add a check to get the proper name of the browser, you need to encode the MP3 or OGG accordingly to the browser brand (Firefox won't play a MP3, Chrome will play both, Opera won't play OGG, and so on...).
The encoding code is done in Flash, I used the Alchemy tool to accelerate some code to the maximum. It's not native speed, but it's way faster than "simple" Flash, or Javascript. The encoding is asynchronous, so you can do other things while it's done.
The code of the encoder is going to be published on GitHub, to let you be sure that the code can be trusted (I'll publish everything back from my holidays).
The MP3 encoder is the Shine MP3 encoder ported to Flash, and the OGG encoder is from there : http://labs.byhook.com/2011/02/15/ogg-vorbis-encoder-for-flash-alchemy-series-part-1/
The demo : https://dl.dropbox.com/u/1412774/MicrophoneC2Demo2/index.html
The .zip : https://dl.dropbox.com/u/1412774/MicrophoneC2Demo2/pode_microphone.1.0.zip
The .capx : https://dl.dropbox.com/u/1412774/MicrophoneC2Demo2/MicrophoneC2Demo2.capx