gurushida / mnemophonix

A simple audio fingerprinting system
MIT License
28 stars 5 forks source link

Comparing short audio files #2

Open galarlo opened 1 year ago

galarlo commented 1 year ago

Hi, I'm interested in finding near-duplicate audio files. My dataset is about 3000 thousands short audio files, between 0.5 seconds to 5 seconds. Unlike Shazam, both the "target" audio (i.e. the songs in Shazam's case) and the user input are short, and both might contain noise.

Can this library help? If so, are there any recommendations for tuning parameters?

N.B - if a file is matched to multiple other files, it's fine - I have a less efficient algorithm that can verify which match is correct. In other words, I can handle some amount of false positives, but I don't want false negatives.

gurushida commented 1 year ago

It might help, yes. This code works well when the sample you want to recognize is actually identical to one of the indexed one, modulo some alterations (noise, volume change, etc). What it does not handle well is speed change. Also, it works better when the audio material contains some discriminant features, like someone singing. If a sample is too perfect (like an electronic music beat), it becomes hard to identify.

Regarding tuning, what you can do is tweak line 110 in main.c like this:

int best_match = search(fingerprint, database_index, lsh, 1);

to turn on verbosity in search(). This will produce additional output regarding the matching scores and may give you hints about how to tweak the scoring in search().