views:

600

answers:

2

OK so Silverlight 4 is adding support for capturing from microphones (and webcams), however for this facility to be useful (in my case at least) I'd need to upload this captured data to a server to save.

The AudioCaptureDevice will record PCM audio on the client, and as we all know PCM is not the most efficient encoding... the data would be too large to upload uncompressed.

Ideally, I could encode this PCM stream to AAC right on the client, then upload that compressed stream to the server.

Something like this library, may be useful. However it doesn't support AAC.

(I'm choosing AAC because (unlike MP3) it is royalty-free to encode, and is supported by popular PMP devices.)

Any thoughts out there on the best way to accomplish this? All options are on the table: full-trust, Google Gears, etc...

Thanks for any help!

+4  A: 

There's an audio codec out there called Speex AND Alden Torres ported the SPEEX algorithm to C#. So you have a full managed audio encoder. Here's the relevant blog post where he shows how to encode the audio from the mic with SPEEX. Read also the comments.

Rene Schulte
wow great link - google never came back with it during my research for some reason :p Unfortunately he doesn't mention AAC - I really wish there was more attention paid to this format - MP3 is patented and cannot encode (legally) for free - AAC is supported on iPod and Zune, and is totally free (and there are free encoders available). This link helps though, thanks!
Bobby
A: 

I need to record a music in Silverlight (e.g. from the line-in) and save it on the server. It must be in a good quality (not like SPEEX). I will try to use a lame encoder on the client. It needs the lame_enc.dll that can be accessed by p-invoke. I will test if it is possible from the silverlight. Do you know some alternatives? Maybe a good stream server (is it possible with wowza)?

Shurup
funny you bring this up, because I'm still searching for a reasonable solution. The problem is MSFT is really dropping the ball here- I was waiting for the SL4 RTM (happened last week) hoping that they'd introduce an A/V encoding solution along with the mic/webcam support.. it looks like they have not. If you wanted to use LAME, or some other unmanaged encoder, you will need to go out-of-browser and elevated trust, something that is asking a lot from your users. What we need is a managed AAC encoder (AAC over MP3 because you must pay to encode MP3, AAC is free and supported by iPods, etc..)
Bobby