Saving microphone data to mp3 in adobe air
Hi I have an adobe air 2 project which records some short sounds via the microphone. I am able to save the streams as wav files 开发者_运维知识库but require them to be saved as mp3 (For replaying in the flash player).
Does anyone know if this is possible? If it isn't is there anyway to get the flash player to player audio in wav form?
Any hints appreciated.
If you are using Adobe AIR v2 then you should be looking for a Non-AS3 commandline tool to convert the wav file to mp3. The process is fairly CPU intensive and would take a LONG time in Actionscript even if there was a library out there that accomplished the task (which I haven't heard of).
My suggestion is to include a tool like LAME with you application and pass your wave file to it (essentially running the process in another thread in C). The only downside is providing an executable for each potential OS you'll be deploying to, if you intend on support Windows, Mac, and Linux that could be up to three different Wave->Mp3 commandline tools.
Link for LAME: http://lame.sourceforge.net/
Seems to be possible: http://www.jordansthings.com/blog/?p=5. No ready source, but libraries listed there should help. (I would just decompile it if need be.)
精彩评论