Recording from a microphone via the web introduces some particular problems. Strangely, the 'sane' option is a Java applet. Java provides you with a Microphone class, which acts like you'd expect a Microphone class to act. You can turn it on, adjust the levels, and get the bytes encoded as WAV or PCM. From here you can send the bytes to a server, or do whatever you want with them. But Java applets are so 1998, and who has a Java plugin for their browser, anyway?
So we're left with Flash. Flash does not provide you with the tools you'd expect. Like Java, Flash also has a Microphone object. But you can't, you know, just get the data. You have to hook the Microphone up to a NetStream, which will only communicate with Flash Media Server. And guess how much that costs?
Some folks have reverse engineered FMS and released a Free equivalent, known as Red5. This lets you send the output of a Microphone to a server, without spending $5,000. But Adobe has another trick up their sleeve. Once your FLV file gets to the server, you'd presumably like to do something with it. But the FLV is encoded using a format known as NellyMoser. This is a proprietary codec, and no transcodecs are readily available for it. Sorenson will sell you a transcodec for converting to MP3, but it's the kind of thing where you have to "call for pricing."
So that's where this tool enters the picture. It will convert NellyMoser encoded FLV files to WAV, which you can then convert to MP3 or whatever else you'd like. It works by leveraging the NellyMoser decoder which is compiled into the standard Flash Player. Behind the scenes, it will parse the NellyMoser frames out of your FLV, generate a SWF with the audio embedded in it, load libflashplugin.so, hand it the SWF, intercept the PCM audio output before it gets to the sound card, and then encode that to a WAV file.
The speed of the conversion process varies, depending on how your FLV was originally encoded. The standard 8khz NellyMoser encoding will happen in 4x time, where as a 22khz encoding will happen in 2x time. The CPU usage is fairly low, though, so this can run many conversions in parallel without any reduction in performance.
- xlib (package libx11-dev)
- A running X server.
- libflashplugin.so version 7. This will not work with version 9.
- To run this on a server that's not running X, you can use xvfb to fake it.
Changes in 0.5 (7/3/07)
- Fixed bug that caused encodings with particularly large FLV frames to fail.
Changes in 0.4 (4/26/07)
- Fixed bug that was preventing more than 24 seconds of audio from being encoded.
- Fixed bug where inexplict reference to libflashplugin.so would cause segfault.
Changes in 0.3 (4/25/07)
- Improved conversion speed by 4x on 8khz FLVs.
- Fixed frame rate bug that was causing strange playback for FLVs encoded with rates other than 8khz.
Changes in 0.2 (4/25/07)
- Fixed sign-extention bug that was causing segfaults on FLVs with embedded SCRIPT tags.