tags:

views:

68

answers:

3

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 ?

A: 

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

maerics
A: 

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.

Samuel Yung
+1  A: 

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.

mdma