LAME is, probably, the best MP3 encoder ever. LAME binaries have two parts :
- A statically linked command line: “lame.exe” on Windows, “lame” on Unixes.
- A dynamic link library/shared object: lame_enc.dll on Windows, libmp3lame.so on Linux and Solaris, libmp3lame.dylib on Mac OS X.
This library exports the standard LAME API as declared in lame.h.
LAMEOnJ is a 100% Java API wrapping the standard LAME API. Under the hood the Java methods call the exported lame_enc.dll/libmp3lame.so/libmp3lame.dylib methods and LAME structures are reflected in symmetric Java classes.
To perform this “magic” LAMEOnJ classes are enhanced with JNIEasy and use the JNIEasy runtime.
JNIEasy is free to personal non-profit use using a temporary evaluation key that can be renewed (downloaded) again with no personal data provided. A commercial license has not this limitation.
LAMEOnJ has two levels or versions:
- A C symmetric API: Java classes and methods mimic the LAME structures and methods. The programming style is almost the same as the C style.
- An Object Oriented API: Java classes and interfaces encapsulating the boring tasks related to C programming in a simpler and robust Java API, and providing quick methods for encoding WAV files or WAV/LPCM streams to MP3 and decoding MP3 to WAV/LPCM.
LAMEOnJ wraps the BladeEnc API too (C and OOP version), this API is old and only provided by the Windows version of LAME (lame_enc.dll).
LAME binaries are not included. Recommended sites to download:
- Windows (the Mac version does not work with Mac OS X 10.4)
- Linux: many Linux distributions include LAME binaries (or can be optionally downloaded), for instance Ubuntu packages, liblame-dev and lame.
- Mac OS X: compile yourself (“configure” and “make”), copy or rename libmp3lame.0.0.0.dylib as libmp3lame.dylib from libmp3lame/.libs to bin/macosx86 folder.
– Download v3.97 source code
– Apply this patch.
– Add gcc to the PATH, for instance:
– Compile the source code:
– Copy or rename libmp3lame.so.0.0.0 as libmp3lame.so from libmp3lame/.libs to bin/solarisx86 folder.
- More links
LAME binaries are not included inside the LAMEOnJ distribution to avoid patent problems. OSTG/VA Software, the owner of the SourceForge.org site (the hosting of this project), is an EEUU company and software patents cover MP3 algorithms included in LAME. Use LAME binaries at your own risk in your country.
Decompress the .zip file, download a new JNIEasy.lic evaluation file/key and put this file in the /bin folder. When the evaluation period ends you can download again a new license file.
Download a recent LAME binary release including dynamic libraries. Decompress, copy and put the dynamic library/shared object into the concrete LAMEOnJ folder /bin/win32x86, bin/linuxx86 or bin/macosxx86.
LAMEOnJ is a development tool. The bin/<platform>/test*.bat and test*.sh files execute Java examples encoding/decoding MP3 files/streams and WAV files/streams using the low level LAME API and LAMEOnJ OOP APIs. You can use the multiplatform Ant file too (build_LAMEOnJ.xml).
LAMEOnJ is packaged as a NetBeans project, useful for editing and compiling individual files (use build_LAMEOnJ.xml for any other task).
LAMEOnJ is open source and licensed under the terms of the business friendly Lesser GNU Public License (LGPL)
- lame.h file documents (briefly) the LAME API.
- LAMEOnJ’s JavaDoc
- BladeEnc interface documentation.
- BladeMP3EncDLL.h file declaring the BladeEnc exported methods and structures.