Skip to main content

Quad-based audio fingerprinting (fork of https://github.com/mbortnyck/qfp)

Project description

Qfp

Qfp is a python library for creating audio fingerprints that are robust to alterations in pitch and speed. This method is ideal for ID'ing music from recordings such as DJ sets where the tracks are commonly played at a different pitch or speed than the original recording. Qfp is an implementation of the audio fingerprinting/recognition algorithms detailed in a 2016 academic paper by Reinhard Sonnleitner and Gerhard Widmer [1].

NOTE: This is a fork of https://github.com/mbortnyck/qfp/ which incorporates:

  • multiple bug fixes
  • Python 3 compatibilty
  • modern packaging with Poetry

This is all in service of having a convient audio fingerprinting service for a website I'm working on.

Quickstart

Install by downloading it from PyPI.

pip install qfp

You can create a fingerprint from your reference audio...

from qfp import ReferenceFingerprint

fp_r = ReferenceFingerprint("Prince_-_Kiss.mp3")
fp_r.create()

...or a query fingerprint from an audio clip that you wish to identify.

from qfp import QueryFingerprint

fp_q = QueryFingerprint("unknown_audio.wav")
fp_q.create()

The QfpDB can store reference fingerprints...

from qfp.db import QfpDB

db = QfpDB()
db.store(fp_r, "Prince - Kiss")

... and look up query fingerprints.

fp_q = QueryFingerprint("kiss_pitched_up.mp3")
fp_q.create()
db.query(fp_q)
print(fp_q.matches)
[Match(record=u'Prince - Kiss', offset=0, vScore=0.7077922077922078)]

Qfp currently accepts recordings in any format that FFmpeg can handle.

Dependencies

FFmpeg - https://github.com/FFmpeg/FFmpeg
NumPy - https://github.com/numpy/numpy
Pydub - https://github.com/jiaaro/pydub
SciPy - https://github.com/scipy/scipy
SQLite - https://www.sqlite.org/


[1] R. Sonnleitner and G. Widmer, "Robust quad-based audio fingerprinting," IEEE/ACM Transactions on Audio, Speech and Language Processing (TASLP), vol. 24, no. 3, pp. 409–421, Jan. 2016. [Online]. Available: http://ieeexplore.ieee.org/abstract/document/7358094/. Accessed: Nov. 15, 2016.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qfp-0.2.0.tar.gz (10.8 kB view hashes)

Uploaded Source

Built Distribution

qfp-0.2.0-py3-none-any.whl (10.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page