wav <> mp3 for flash(as3)

不羁的心 提交于 2019-12-03 15:19:38

See LAME MP3 Encoder. You can checkout their source code and their link page. Mpeg.org should have documents too.

You could also theoretically do this as a PixelBender filter, and should get significantly better performance than using a pure ActionScript 3 implementation.

More info on PixelBender here:

http://labs.adobe.com/wiki/index.php/Pixel_Bender_Toolkit

mike chambers

mesh@adobe.com

I've got a project converting WAV files (actually Asterisk voice mails) into MP3's. If I remember correctly there are some oddities about Lame's license, so I've downloaded and compiled first LAME, then SOX by hand.

I have a web process written in PHP to actually convert the files from WAV to MP3 on the web server's local file system (actually PHP is just supervising the command-line sox tool via exec()). Then I attach all the metadata the MP3 needs using the PEAR Mp3_Id package.

Then I move the newly constructed MP3 file into a folder Apache is sharing, and point the outstanding SoundManager2 flash-based MP3 player at it.

For small transactions this works very well -- converting a minute or two voice mail does not add any appreciable lag to actually rendering and returning the rest of the page. As I get more users on a single server, it will probably eventually become necessary to write a cron job or something to do the conversion before the user actually asks for the file the first time.

It's going to be VERY slow doing this in AS3. You really need a C/C++ implementation if you care at all about how long it will take.

Andre Michelle and the Hobnox guys pulled off something similar with their Hobnox AudioTool, they ported a Java Vorbis encoder to AS3. They supposedly ended up with encoding taking twice the time of the audio duration.

Don't know what your use case is, but in the Hobnox tool apparently audio is created at the client side, encoded as Vorbis, sent to the server, converted to mp3 and stored in the users library.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!