Skip to content

Audio fingerprinting and recognition in Python

License

Notifications You must be signed in to change notification settings

BernardoGiordano/dejavu

 
 

Repository files navigation

dejavu

Purpose

This fork attempts to:

  • [:heavy_check_mark:] Fix bugs (fixes critical numpy one).
  • [:heavy_check_mark:] Use SQLAlchemy to support PostgreSQL, SQLite3 DBs as well.
  • [:heavy_check_mark:] Use Pipenv to allow db credentials via .env file
  • [:heavy_check_mark:] Support both Python3 and Python2.
  • [WIP] Use the logging module so as to not litter any user's application with prints.
  • [:heavy_check_mark:] Reformat code using YAPF (Facebook)

Usage

  1. Install directly from this repo:
pip install -e git+https://github.com/bcollazo/[email protected]#egg=PyDejavu
  1. Import and use:
from dejavu import Dejavu
from dejavu.recognize import FileRecognizer

djv = Dejavu(dburl='sqlite:https://')
djv.fingerprint_directory('~/Music')
song = djv.recognize(FileRecognizer, 'mp3/Dura--Daddy-Yankee.mp3')
print(song)
  1. Can also be used as a CLI tool:
export DATABASE_URL=mysql+mysqlconnector:https://bryan:password@localhost/dejavu
python dejavu.py --fingerprint ~/Music mp3 --limit 30
python dejavu.py --recognize mic 10
python dejavu.py --recognize file sometrack.mp3

You can keep the database url saved in an .env file and use pipenv. As well as specify it via the --dburl command line argument.

Migrating from worldveil/dejavu

If you already have a live database that used to follow worldveil/dejavu database structure, you'll have to migrate your database by renaming:

  • song_id to id
  • song_name to name

in the songs table.

About

Audio fingerprinting and recognition in Python

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 98.6%
  • Shell 1.4%