This project is a web-based song recognition system built with Flask. Users can upload an audio clip, and the app will attempt to identify the song by comparing it against a database of reference tracks. The system combines classic audio fingerprinting (Shazam-style) and modern deep learning (YAMNet embeddings) for robust and accurate recognition. You can also add new reference songs to the database via the web interface.
git clone https://github.com/sh4shv4t/SonicSig
cd song_recognizer_apppython -m venv venv
venv\Scripts\activate # On Windowspip install -r requirements.txtGenerate a secret key:
python -c "import secrets; print(secrets.token_hex(32))"Set it as an environment variable:
set FLASK_SECRET_KEY=your_generated_key # Command Prompt
# or
$env:FLASK_SECRET_KEY="your_generated_key" # PowerShellpython song_recognizer_app/app.pyVisit http://127.0.0.1:5000 in your browser.
-
Fingerprint-Based Recognition:
The app computes a spectrogram of the audio, detects prominent frequency peaks, and generates unique hashes (fingerprints) from pairs of peaks. These fingerprints are matched against those of reference songs to find the best match. This approach is robust to noise and short clips. -
Embedding-Based Recognition (YAMNet):
The app uses YAMNet (a deep learning model) to extract high-level audio embeddings from both the query and reference tracks. It then computes cosine similarity between embeddings to identify the closest match. This method captures more abstract audio features and is robust to variations in timbre and instrumentation. -
Result Combination:
Both methods are run for each query. The result with the higher confidence is shown to the user.
- Upload an audio clip to identify the song.
- Add new reference songs to the database.
- Supports
.mp3and.wavfiles. - Uses both classic signal processing and deep learning for robust recognition.
song_recognizer_app/
│
├── song_recognizer_app/
│ ├── app.py # Main Flask app
│ ├── recognizer.py # Fingerprint recognition logic
│ └── ... # Other modules
│
├── static/uploads/ # Uploaded and reference audio files
├── templates/ # HTML templates
├── requirements.txt
└── README.md
- For best results, use clear audio clips with minimal background noise.
- The app is for educational/demo purposes and can be extended for larger-scale use.