Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fingerprint differences compared with fpcalc.exe #10

Open
powercode opened this issue Aug 18, 2024 · 1 comment
Open

Fingerprint differences compared with fpcalc.exe #10

powercode opened this issue Aug 18, 2024 · 1 comment

Comments

@powercode
Copy link

I'm using the following code

        var fileName = @"C:\The Platters - The Great Pretender.mp3";
        var decoder = new NAudioDecoder(fileName);
        var ctx = new AcoustID.ChromaContext();
        ctx.Start(decoder.SampleRate, decoder.Channels);
        decoder.Decode(ctx, 120);
        ctx.Finish();
        var fingerPrint = ctx.GetFingerprint();

and compare the results to

fbcalc.exe -length 120 "C:\The Platters - The Great Pretender.mp3"

In both cases, the fingerprints are 3806 characters long and equal up to position 3200. After that, they differ.

Do you know if this is expected?

Both fingerprints can be used to resolve against the web service, and both have almost the same score (0.9830894 vs. 0.98312235), where the fbcalc.exe score is slightly more accurate.

Am I missing something here? Can I do anything to become more compatible with the fpcalc result?

@wo80
Copy link
Owner

wo80 commented Aug 18, 2024

I don't think it's worth worrying about that. The first thing you could try is converting to wav format and 11025 Hz mono. Then compare the fingerprints of that wav file. That would rule out differences created by audio preprocessing.

But even then the fingerprints cannot be expected to be exactly the same. There's a lot of floating point arithmetic involved in the process and small differences might show up leading to different fingerprints in the end.

EDIT: additionally, I haven't compared my C# code to the original C++ code for a long time now, so the implementation details might have diverged a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants