There already is this kind of tool in the source code ("fpcollect"),
but it's not very cross-platform and depends on a number of external
libraries (FFmpeg, Boost, TagLib). I'm planning to write a more
generic tool, but I'm still not sure about the audio decoding part.
FFmpeg is the obvious choice for me, I think using CoreAudio would be
preferable on OS X.
Lukas
rmason@slate:/btrfs/randall/music$ gst-launch-0.10 -t filesrc
location=01\ Animal\ Instinct.mp3 ! decodebin ! audioconvert !
ofa ! chromaprint duration=60 ! fakesink sync=0 | grep -i fingerprint
And you will get both a chromaprint and an ofa (Open Fingerprint from
MusicIP) fingerprint:
chromaprint fingerprint: [FINGERPRINT HERE]
ofa fingerprint: [FINGERPRINT HERE]
I used it to go through my whole collection and look for duplicates in
different formats:
find . -type f -print0 | xargs -0 -n1 -P1 -I{} bash -c 'echo "***";
echo "{}"; gst-launch-0.10 -t filesrc location="{}" ! decodebin
! audioconvert ! ofa ! chromaprint duration=60 ! fakesink sync=0 |
grep -i fingerprint' > chromaprints
Once again, I think only on Linux, but I don't know much about the
possibility of gst on Mac.
Randall Mason
ran...@mason.ch
2011/5/6 Lukáš Lalinský <lali...@gmail.com>:
I wrote a minimalistic version of the included tools, please let me
know if it works for you. Here are statically linked binaries for
Windows and OS X without any dependencies:
Windows
http://dl.dropbox.com/u/5215054/fpcalc/fpcalc.exe
OS X (Intel, probably works only on 10.6 too)
http://dl.dropbox.com/u/5215054/fpcalc/fpcalc
Source code
https://github.com/lalinsky/chromaprint/blob/master/examples/fpcalc.c
Lukas
The minimum length should be somewhere around 12 seconds. Songs that
are shorter than 50 seconds are treated differently and it still
attempts to match them.
> What are the effects of changing the length parameter ?
With the current settings, the server will match the query only if its
length difference compared to the database is within 7 seconds. I'm
planning to have this configurable by the application.
> I have one mp3 that failed the fingerprint analysis, do you want it ?
Yes, definitely.
> Can we have a linux binary as well ?
Yep, I'll release a new version of Chromaprint and publish binaries
for windows/osx/linux. Btw, if you still have a PPC machine somewhere,
could you please test if http://dl.dropbox.com/u/5215054/tmp/fpcalc
works? It should work on i386 10.4+, but I'd like to verify that it
works on PPC as well.
Lukas
Oh, sorry, I meant the webservice parameter. :) Yes, you are right,
this is option allows you to specify how much data to use for the
fingerprinting process. This is independent from the song length,
which you also have to send to the web service. That is, if you have a
file that has 3 minutes, you can calculate a fingerprint from the
first 60 seconds, send the fingerprint along with the information that
the complete song has 180 seconds (this is the number that has to
match +/- 7 seconds) to the webservice and get the result.
Lukas
If you change it to 30 seconds, you might miss some matches. If you
change it to less than 20 (and the song is actually longer), you will
not get any matches at all. If you change it to a larger value, you
might avoid some false positive matches (e.g. if the track differs
significantly after the first minute). More than 120 seconds doesn't
make sense, because there are no fingerprints in the database with
more data currently.
Lukas