views:

2014

answers:

6

Hello all!

I am writing my masters thesis which is closely related to processing sound files (mp3 and alternative formats such as ogg, aac, ...) and sound in Java. Because Java has so much open source support, I didn't think I would have any problems in finding everything I need already coded, but so far results are very sparse.

I want 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, ...

+2  A: 

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

64BitBob
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.
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?
64BitBob
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.
64BitBob
+1  A: 

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.

Andreas Holstenson
+1  A: 

I can also vouch for jlayer as being good for playing. Used it a couple of years ago and it just did the business without any fuss. Not sure about meta stuff though

brad
A: 

I want libraries to:

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

For this part, refer to this question:
I need an ID3 tag reader library for Java - preferably a fast one

There are a couple of promising-looking Java ID3 libraries listed.

Jonik
+1  A: 

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

Christian Pesch
+1  A: 

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.

Xuggle