i want to achieve mp3 compression.. it means i want to convert a 256kbps mp3 file into a 128 or even 64kbps mp3 file using java programming language..
is it possible using JLayer..? how do i do it..?
A code snippet would be useful
i want to achieve mp3 compression.. it means i want to convert a 256kbps mp3 file into a 128 or even 64kbps mp3 file using java programming language..
is it possible using JLayer..? how do i do it..?
A code snippet would be useful
To convert an MP3 file to a file of lower bitrate, you must decode and re-encode the file, so you need an MP3 decoder and an MP3 encoder.
You'll have to find a Java library for de/encoding MP3. One option would be LameOnJ. It's a wrapper for the "lame" MP3 encoder, and uses a platform-specific binary/DLL.
There might also be a pure Java solution, but I don't know any.
See also MP3 Encoding in Java
Decoding MP3 is straightforward. However, encoding MP3 is fraught with patents, licenses, and general legal mayhem. LAME is one possibility to adapt, but it too suffers from potential litigation encumbrances. It is also known to be poor at lower bit rates. It is written in C, so you'd have to do translation.
JLayer is decoding only. There is no 100% java solution for encoding. LAME is officially distributed in source code only, so if you want to avoid patent infrigement, you can not distribute LAME binaries with your program without buying a license.
If you are searching for a pure java version of lame, check out these sources: http://jsidplay2.cvs.sourceforge.net/viewvc/jsidplay2/jump3r/