worldveil / dejavu

Audio fingerprinting and recognition in Python
MIT License
6.36k stars 1.43k forks source link

Different sample rates aren't recognized #228

Closed outhud closed 4 years ago

outhud commented 4 years ago

I have a 44.1kHz 320K mp3 audio file fingerprinted. If I run this mp3 back through the recognizer, it matches (of course).

I then converted it to 48kHz with PPHS resampler via foobar2000 and encode it as 320K mp3. This 48kHz mp3 is then not recognized by dejavu as being a match of the 44.1kHz source.

Finally, I took the 48kHz mp3 and resample this back to 44.1kHz and re-encode again as mp3 320k, and this 44.1kHz mp3 does match with the original. I think this shows the problem is not because of some unique features in the frequency spectrum being lost in the resampling or re-encoding steps.

(I suppose it's because the unique features appear at different points / bins in the FFT when you resample, but that's where my knowledge ends :) )

worldveil commented 4 years ago

Hm, no the difference lost to Nyquist in sampling differences at 44khz vs 48khz shouldn't relevant. The frequencies at which this would be meaningful to Dejavu are above most human hearing thresholds. If you listen to the two tracks yourself, do you hear a difference?

if that is not the issue likely it is whatever process Dejavu uses to turn such a file into a list of integer samples for the audio file itself.