Ahmed Doghri Logo Image
Ahmed Doghri

audiocatalog

Exports multiply while recordings stay the same. Six pair checks find the one duplicate at 99.48% similarity across WAV and MP3 names.

audiocatalog acoustic fingerprint duplicate index
audiocatalog working browser demo

File Hashes Miss Audio Identity

The same recording changes bytes when it is transcoded, retagged, renamed, or wrapped in a new container. Cryptographic hashes then treat one song as unrelated files.

audiocatalog invokes the proven fpcalc binary, stores duration and raw Chromaprint fingerprints in SQLite, gates implausible duration pairs, and ranks likely acoustic duplicates.

Keep The Library Local

Directory indexing and matching run without uploading music or requiring an API key. The CLI handles real files while the API and workbench expose the comparison contract for inspection.

The Demo

Four catalog entries produce six pair comparisons. Exactly one pair crosses the threshold: differently named WAV and MP3 exports of the same recording at 99.48% similarity.

Chromaprint is optimized for near-identical audio, not general cover-song, remix, or sample detection. Every candidate remains a review decision.

The Similarity Score Wasn't A Fixed-Width Metric

Chromaprint fingerprints are arrays of fixed 32-bit words. The similarity function normalized each word's bit difference by how many bits that specific number needed to represent itself — not by the actual 32-bit width every word occupies. That makes the score depend on the numeric magnitude of the fingerprint values, which has nothing to do with how acoustically similar two recordings actually are.

Checked against real fpcalc output: raw fingerprint words come back in the hundreds-of-millions range, roughly 30 bits of magnitude. The demo's own illustrative fixture uses values all under 65536, 8 to 16 bits. That mismatch is exactly why the bug distorted the published numbers so much — with the old value-dependent normalization, unrelated track pairs scored 38–46%; with the correct fixed-32-bit metric, they score 70–74%. The published "real separation, not a near-miss" framing was manufactured by the bug and unrealistic demo values, not by genuine acoustic dissimilarity.

Fixed to a constant 32-bit-per-word normalization, then stress-tested against 30 trials of realistic random 32-bit fingerprints with small bit-flip perturbations simulating re-encoding noise: the corrected metric always ranks a near-duplicate above an unrelated track, exactly matching the theoretically correct Hamming similarity. The demo still finds exactly one duplicate pair, comfortably above threshold — the tool's core claim holds, just with honest numbers behind it.

Implementation Basis

The project builds on the open-source Chromaprint acoustic fingerprinting algorithm and its fpcalc command-line implementation.

Read the Chromaprint.

Tools Used

Python
Chromaprint
fpcalc
SQLite
Audio Fingerprinting
Music Information Retrieval
Hamming Distance
Docker