Any good recommendations for MP3/Sound libraries for java?

37,433

Solution 1

JLayer should do everything you need. It's not dead, it's just stable. The author finished it up quite a long time ago and the MP3 format has not seen much change since. You'll notice that his MP3SPI codebase is a little more recent. What MP3SPI does, is that translates JLayer's abilities into JavaSound APIs. Thus you can take any JavaSound code, add MP3SPI to the classpath, and expect that MP3 files will start working. It's pretty nifty. :)

Solution 2

You could try Xuggler. Here's how it does on your tests:

* read and write meta data (for example ID3v2 tags in mp3 and all):

if the underlying container type has meta-data support in FFmpeg, Xuggler supports it.

* convert compressed to to raw audio data and if possible raw audio data to mp3, ogg, aac, ...

Xuggler supports mp3, ogg (vorbis or speex), speex, vorbis, flac, aac, etc.

* digitally process the audio data (energy, timbre, Mel Frequency Cepstral Coefficients - MFCC, FFT, LPC, Autocorrelation, Wavelet, ...)

Xuggler does not have DSP modules so you'll need to find another library for that. But Xuggler will give you the raw data.

Solution 3

Btw, I've just moved my MetaMusic project to http://github.com/cpesch/MetaMusic/ since the infrastructure there is much better.

Solution 4

You should try to looking into gstreamer-java, I've had success with playing media via it and it should be possible to convert audio files with it. There is also JFFMpeg that integrates into JMF, I haven't poked around that much with it so I don't know the total extent of its capabilities and state, but its something to look at more closely.

Share:
37,433

Related videos on Youtube

Charlie
Author by

Charlie

Updated on March 04, 2020

Comments

  • Charlie
    Charlie about 4 years

    I'm looking for libraries to:

    • read and write meta data (for example ID3v2 tags in mp3 and all)
    • convert compressed to to raw audio data and if possible raw audio data to mp3, ogg, aac, ...
    • digitally process the audio data (energy, timbre, Mel Frequency Cepstral Coefficients - MFCC, FFT, LPC, Autocorrelation, Wavelet, ...)

    I already know and am not content with:

    • JMF: original from Sun, reads mp3 and turns it into WAV. But does not read meta data nor provide any advanced digital processing features.
    • FMJ: Alternative implementation to JMF with same limitations.
    • jAudio: Not stable and although potential, currently not well maintained.
    • Marsyas: In digital processing just what I had hoped for, but in C++. Maybe some port / integration already available?
    • JID3: API for meta data, but seems to be dead (last release 2005/12/10).
    • JLayer: API for reading and playing, also dead (last update 2004/11/28).
    • MetaMusic: API of the program is neat but no official standalone open source project. Therefore has no community, future support and all...
    • Light Dev: Some interesting features, but not at all complete.

    This is what some of my own investigation has turned up. I would greatly appreciate all input, suggestions, critics, ...

  • Admin
    Admin over 15 years
    Thank you for answering and you're right, it's great for mp3, but... as far as I've seen (please correct me if I'am wrong) it does not support any future audio formats like ogg, aac, ... - and "finished" means it never will. Also no digital processing is available.
  • Wadhawan994
    Wadhawan994 over 15 years
    OGG is a different library. You want to use JOrbis and/or VorbisSPI. VorbisSPI is by the same author as JLayer. If you want to do digital processing, use the SPI frameworks. They allow you to use the JavaSound APIs to digitally process to your heart's content. Do you understand how SPIs work?
  • Wadhawan994
    Wadhawan994 over 15 years
    Sorry, ran out of space. AAC is the newest format, but you're going to have some trouble finding free codecs. It's religiously protected by the patent holders to prevent a repeat of the MP3 issues. For AAC I recommend Quicktime4Java or IBM's MPEG4 APIs.
  • ajacian81
    ajacian81 about 11 years
    Just so people know, Xuggler appears to be exclusively Intel based, and thus can't be used on iOS or Android devices. (There's native code that needs to be built, it's not Java only).
  • joshreesjones
    joshreesjones about 10 years
    I am using TinySound (based off of JLayer and the Java Sound API) and I had tinysound, tritonus, and jlayer in my classpath. MP3s did not work, so I found this answer and tried adding mp3spi to my classpath - that didn't work either. Any suggestions?