7

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).

Laurent S
  • 4,106
  • 3
  • 26
  • 50
  • I would guess a server side solution would be best – Mild Fuzz Mar 09 '12 at 14:41
  • Server side is what I have so far. It does the job, but can get pretty heavy in terms of resource usage, which may affect availability of the website. – Laurent S Mar 11 '12 at 12:00
  • yeah, but doing that in browser will be tough on low spec machines. Maybe you need to queue the jobs, to minimise concurrent resource consumption? – Mild Fuzz Mar 11 '12 at 18:27
  • ...and still do it server side – Mild Fuzz Mar 11 '12 at 18:37
  • that's probably what I'll go for if I can't find a better solution. This creates async processing issues, but hopefully we can work around it. Thanks for your suggestion. – Laurent S Mar 12 '12 at 19:18

1 Answers1

1

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.

  • check out this so question http://stackoverflow.com/questions/9134936/how-to-call-speex-audio-decode-encode-in-html5-javascript-without-flash – Michael Dausmann Oct 03 '13 at 23:29