开发者

audio processing using java

开发者 https://www.devze.com 2022-12-27 10:40 出处:网络
We have a requirement where we need to convert from .wav file to .mp3 and we are currently using \"Tritonus\" library to do that . The concern with that library isthat requires \"installation\" of som

We have a requirement where we need to convert from .wav file to .mp3 and we are currently using "Tritonus" library to do that . The concern with that library is that requires "installation" of some "dll" files to the class path.

I am wondering are there any API's those allow better processing without local installation. And other question is ,having mp3 format files will make it easier开发者_运维知识库 to join the files into a single file than having .wav files ?


As a former contributor to the JLayer MP3 Library, I'm fairly sure that it doesn't do WAV to MP3 - just MP3 playback and conversion to WAV. (I spent some time optimizing the decoder :-)

Regarding appending files (and possibly other operations), it is generally better to perform edit operations using the uncompressed format, and compress at the end.

I think the spec allows mp3 files to be concatenated, since they are a series of frames, but behaviour may vary from player to player.

So, to be safe, and maintain quality, I'd concat using WAVs and then compress the final result to MP3. Concating files is not so straightforward - you have to at least make sure they are at the same percieved volume, or you will get a noticible shift in volume from one file to the next. Such operations are definitely best performed on the uncompressed data.


The JLayer MP3 Library appears to support several operations on MP3 and WAV files including conversion, with no native libraries to install.


You can use MP3SPI to do this. This is a java sound plugin, just include the jar into the classpath, and you can use java sound api to convert between wav and mp3.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号