Identify any audio playing on your computer (or microphone) and automatically download GIFs relevant to artist, track and mood. Audio is fingerprinted and identified using Gracenote, which also provides metadata on the mood/emotion, then GIPHY is used to download GIFs based on the artist, track and mood keywords. The program runs on a loop in the background, checking every minute for the current song and generating GIFs.
-
Install PyAudio, Soundflower and SwitchAudioSource.
-
Install the dependencies:
pip install -r requirements.txt
-
In Audio MIDI settings, create a multi-output device. The master device should be "Soundflower (2ch)" and it should use "Soundflower (2ch)" and "Built-in Output". This will allow the script to listen to the audio through the Soundflower device while you continue to hear it through the computer's output. Name the multi-output device "Multi-Output Device (Built-in)" by double-clicking on the name. The script will look for a device with this exact name.
-
The script will look for configuration details in a config.rc file that you need to create. You'll also need to create your own Gracenote app and GIPHY app through each of their web interfaces (for free), and replace the details below in the file:
APP_PATH /gracenote/identify-audio
GRACENOTE_LICENCE_PATH gracenote/license.txt GRACENOTE_CLIENT_ID your_details GRACENOTE_CLIENT_TAG your_details GRACENOTE_WEB_ID your_details GIPHY_API_KEY your_details
- If you do not have OS X 64-bit you will need to recompile the executable using the Gracenote SDK (it's free).
-
Run using
python main.py
while music is playing. -
GIFs are downloaded to the
gif/
folder if a match is found. Each time a new song found, the folder is emptied and replaced with the new song gifs. -
RECORD_INTERVAL_MIN
(inmain.py
) determines how long the program will wait before trying to identify another song. -
GIF_LIMIT
(inmain.py
) determines the amount of GIFs downloaded for each term (artist, track, mood).
- Sync speed of GIF to the song BPM
- Lyrics keyword recognition