New Technologies

  • Java
  • Javascript
  • DTML
  • Dot Net
  • ASP .Net
  • C# .Net
  • PHP
Your Ad Here

Thursday, February 5, 2009

LAME mp3 java sound recordera

Overview

LAME is, probably, the best MP3 encoder ever. LAME binaries have two parts :

  1. A statically linked command line: "lame.exe" on Windows, "lame" on Unixes.
  2. 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.

    The Windows version (lame_enc.dll) exports the API too, this API is backward compatible with the old BladeEnc MP3 encoder.

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:

  1. 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.
  2. 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).

Download

At Sourceforge.

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.
  • Solaris:
    - Download v3.97 source code
    - Apply this patch.
    - Add gcc to the PATH, for instance:
    PATH=/usr/sfw/bin:$PATH
    export PATH
    - Compile the source code:
    ./configure; ./make
    - 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.

Installation

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.

Run

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).

License

LAMEOnJ is open source and licensed under the terms of the business friendly Lesser GNU Public License (LGPL)

Documentation

Sources:

  1. lame.h file documents (briefly) the LAME API.
  2. LAMEOnJ's JavaDoc
  3. BladeEnc interface documentation.
  4. BladeMP3EncDLL.h file declaring the BladeEnc exported methods and structures.

 

No comments:

Your Ad Here