4

Has anyone managed to use acoustid (http://acoustid.org/chromaprint) in an Java application? Accessing the chromaprint clib should be easy but I can't just pass in the audio file. I requires the raw uncompressed audio data.

I've tried using xuggler to get the uncompressed audio but didn't get anywhere. Basically I have no idea how to get the raw audio from encoded files like mp3/m4a/etc

Has anybody managed to make this work? Anyone mind sharing their code?

rednoah
  • 1,053
  • 14
  • 41

1 Answers1

4

I suggest you use the fpcalc command line tool (included in Chromaprint, binaries for Windows/Mac/Linux are included on the website), run it in a subprocess from your Java application. You get output like this, which should be easy to parse:

FILE=/path/to/file.mp3
DURATION=398
FINGERPRINT=AQADtEqkRIkkrQ...

That's how most programs integrate AcoustID and I believe it's the easiest way.

Lukáš Lalinský
  • 40,587
  • 6
  • 104
  • 126
  • I'd usually prefer directly hooking into native code rather than calling a subprocess. I'll just prototype ahead with that then. Thanks for the quick reply! – rednoah Jan 10 '13 at 14:07
  • I see you're the developer of Acoustid. I was just wondering if it was possible to also provide fpcalc as c-library as well as as executable? If it was a native lib I could also deploy that feature via WebStart. – rednoah Jan 10 '13 at 14:11
  • It's very unlikely that I'll do it, but if somebody was willing to refactor the code to a "chromaprint-extra" kind of library, I wouldn't be against. Calling it as a subprocess has many benefits, e.g. FFmpeg, which is used by fpcalc, occasionally crashes and if it was a library, it would take the application down. – Lukáš Lalinský Jan 10 '13 at 14:46
  • I see your point. It's running very smoothly now with the subprocess. Especially since I can just pass in many file arguments at once there's no overhead really. – rednoah Jan 11 '13 at 00:53
  • like how to use this in Android ? – Bhanu Sharma Oct 07 '15 at 11:02
  • You can't. Unless you can port fpcalc to Android, which you will find exceedingly difficult. – rednoah Oct 07 '15 at 18:55