worldveil / dejavu

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

Wrong calculation of `offset_seconds` for non-default framerate #258

Open rstrobl opened 3 years ago

rstrobl commented 3 years ago

The offset_seconds calculation uses the DEFAULT_FS even if the fingerprinted tracks have a different framerate (e.g. 48k)

nseconds = round(float(offset) / DEFAULT_FS * DEFAULT_WINDOW_SIZE * DEFAULT_OVERLAP_RATIO, 5)

Suggested solution: Store the framerate of the fingerprinted tracks in the database and use it for calculation.