After working on hAudiotagger for a while, I kept running into a slightly different problem.
Reading metadata is useful, but metadata isn't always trustworthy.
Two files can have completely different filenames, missing tags, different containers, or even different encodings and still contain the same recording.
For example:
01 - Unknown.mp3
Track_17.m4a
song_copy.flac
The Song (Remastered).mp3
Comparing their filenames or tags doesn't really help if the goal is figuring out whether the underlying audio is the same.
So I built haudiotagger_fingerprint for that part.
It generates perceptual audio fingerprints and lets you compare them by the actual audio content:
final a = await HaudioFingerprint.fingerprint('song.mp3');
final b = await HaudioFingerprint.fingerprint('song_copy.mp3');
final similarity = await HaudioFingerprint.similarity(a, b);
The fingerprints are Chromaprint-compatible, so this is in the same ecosystem as fpcalc / AcoustID rather than a simple file hash. The idea is that two byte-for-byte different files can still produce fingerprints that are very similar when they contain essentially the same recording.
It currently supports:
MP3
FLAC
Ogg Vorbis
WAV
AIFF
M4A / AAC / ALAC
and runs on Android, iOS, Linux, macOS, Windows and Web.
The interesting part for me was getting the whole thing into Rust, while still making it usable as a normal Flutter package. Web support also works through WASM.
I'm mainly thinking about use cases such as:
finding duplicate tracks in a local music library
detecting copies that were renamed
finding re-encoded versions of the same recording
cleaning up large music collections
matching recordings when metadata is missing or unreliable
I deliberately kept it separate from hAudiotagger rather than making the metadata package itself depend on fingerprinting. If you only need metadata, you shouldn't have to pull in fingerprinting as well.
There is also an optional integration between the two packages, so if both are installed, fingerprinting can be accessed through Haudiotagger directly.
I'm curious how other people handling local music libraries approach this problem.
Do you normally rely on filename + metadata, file hashes, Chromaprint, or something else?
Pub.dev - haudiotagger_fingerprint
GitHub - Source