Fancy new program: gst-music-hash
I wrote a new program to fix my problem with duplicate music files that’s somewhat handy; it uses GStreamer framework to decode a music or movie file, then uses the libfooid library to calculate a unique number based on the contents of a file. Why is this useful? Well, it means that if you converted half your library to M4A for example, you could find the old MP3 files and delete them off the disk. I’m going to write a Ruby script that’ll do just this in the next few days, but in the meantime here’s the program itself.
Source Code: gst_music_hash-0.1.tar.bz2
Debian / Ubuntu package: gst-music-hash_0.1-1_i386.deb
The program is pretty buggy like any other program I just throw together for my own use, it doesn’t handle errors very well. If you put it in a script, it returns 0 on success so you can use that to determine whether the output is a valid hash. Next, I’m going to try to optimize it using the liboil library, but unfortunately I can’t get oprofile to work on my machine so that’s definitely a thorn in my profiling side.
In Source package there are the .C files *BUT* I can’t find the headers.
Giuseppe Mastrangelo
13 Nov 06 at 4:59 am
You may be interested in a few lines from regress.c (taken from the original libfooid-1.0.zip)
===============================
if (ssyy <= 0.0f + EPSILON) {
*r = 1.0f;
}
/*
b = ssxy / ssxx;
a = avy – b * avx;
*/
rsq = (ssxy * ssxy) / (ssxx * ssyy);
/*
It seems that rsq ^ 0.25 follows roughly
a normal distribution, so thats our preferred
way of looking at things
*/
*r = (float)sqrt(sqrt(rsq));
===============================
In the case where ssyy == 0, it sets *r. However, it then continues and uses ssyy as a divisor(!), and also sets *r to another value. Bug? Feature? You decide.
I have some audio streams that hit this snag. It’s not too uncommon.
"AutoTag" found with the original libfooid, installs a tool called FooID.exe which is a simple command-line program to get the fingerprint of wav files. It makes me wonder if it suffers any issues because of this, or if it’s using some unreleased code.
m35
17 Mar 07 at 1:19 pm
Hi, I’ve fixed the above bug in my branch of libfooid at https://code.edge.launchpad.net/~tsmithe/what-tune/libfooid
That branch also has a happy build system, but it is not api compatible, as I’ve done a bit of restructuring so that it makes more sense.
Toby Smithe
14 Jan 08 at 1:07 pm