I am working on getting audio recorded directly in browser and POSTed to a webserver. I am currently relying on flash to access the user microphone (using code derived from https://code.google.com/p/wami-recorder/) and passing the recorded Wav/pcm blob from flash to JS for upload (using XHR post). This works fine, but I am trying to avoid sending uncompressed WAV data (I can compress the audio on the server, but I am trying to limit CPU intensive work there).
Options I have found so far to compress to ogg on client side include:
relying on lab features of flash to compress the audio to ogg (labs.byhook.com/2011/02/15/ogg-vorbis-encoder-for-flash-alchemy-series-part-1/). Since it is an experimental feature in flash, it's risky to rely on it.
porting a minimal subset of libvorbis to javascript so that the browser can compress the data. This probably sounds a bit silly, but I only need short audio bits (a few seconds) so performance may not be such an issue. I have looked around, but couldn't find any such project going on.
a few other browser specific solutions such as http://firefogg.org which require substantial user-side install to work, which I don't want.
I'm looking for a better option to solve this issue, if such an option exists. I am obviously waiting for html5 getUserMedia() to work, but I need a solution in the meantime that works cross-browser (not necessarily 100%, but at least on major/recent browsers).
Flash: https://github.com/maxl0rd/standingwave3 eg: www.jordansthings.com/blog/?p=5 support mp3.
js compression: https://github.com/jpemartins/speex.js no good examples.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With