Have you used Shazam or asked siri what song is this?
to identify the song currently being played? Basically, these systems record a song with mic and compare the recording with existing database of the songs. The project is basically same thing.
pip install -r requirements.txt
On linux you can do it by
sudo apt install ffmpeg
On windows you can download build from here
If path to ffmpeg is already in PATH then just write ffmpeg
That's it 😃
First you need to create a database of songs which can be searched to identify a song.
- To do that put the songs that you want to include in db in the
raws
folder. You can put them somewhere else as well, if you do that just put the absolute path to that folder inconfig.json
- Run db creator script
python audio_db_creator.py
You will see 2 files (db.pickle
and metadata.pickle
) in db
folder. That is your database of songs. Again, you can put them somewhere else as well, just set absolute path in config.json
Record songs with your computer/phone and put them in recordings
folder. If you wish to put them somewhere else set path in config.json
Run the matcher script
python audio_matcher.py
And voila you will see which recording matches with songs
Note : I am currently in process of improving the search algorithm
A detailed explaination of the algorithm can be found here