Shaxam is an Advance music recognition desktop application that allows users to identify songs through audio fingerprinting. It offers a sleek UI, real-time audio recording, Alogrithmn-based song matching, and visualization of audio fingerprint alignment.
This project combines:
- 🖥 Electron — For building cross-platform desktop applications.
- ⚛️ React + Tailwind CSS — For a responsive and animated frontend UI.
- 🐍 Flask — For a lightweight Python backend API.
- 📊 Matplotlib + Seaborn — For generating visualizations of fingerprint matches.
- 📈 Sqlite - A file based database which is lightweight.
- 🎵 Song Recognition: Click a button to start listening and identifying songs in real-time.
- ⚡ Advance Fingerprinting: Fingerprints with the help of librosa by converting the audio file in a spectogram and finding the peaks and hashing it.
- 📈 Fingerprint Visualization: See a plotted graph showing how your input aligns with known tracks.
- ⚡ Responsive & Dark-Themed UI: Built with Tailwind for elegant, modern interfaces.
- 🔀 Electron Integration: Desktop-friendly, packaged React app.
- 🔊 Microphone Input: Captures 5 seconds of audio on recognition request.
- 🔄 Cross-Origin Support: CORS enabled for React ↔ Flask communication.
- 🆕 Add Songs: Add Songs from Spotify Links.
- React 19
- Tailwind CSS 3
- Electron (via
electron.js) - @shadcn/ui (UI primitives)
- Concurrently & Wait-on for syncing React and Electron during dev
- Flask as the Python web server (
py_server.py) - Flask-CORS for cross-origin requests
- Custom Modules:
mic_record.py– records audio inputgenerate_fingerprint.py– creates audio fingerprintsmatch.py– performs fingerprint matchingplot.py– generates visual match alignment as base64 imagespotify_handler.py- fetches the song metadata from the spotify link using spotify Web APIyoutube_handler.py- downloads the audio from web usng yt_dlp
- Node.js ≥ v16
- Python ≥ 3.8
- Python dependencies (use a virtual environment):
pip install -r requirements.txtOr if using pyproject.toml:
pip install .cd electron-app
npm install SPOTIFY_CLIENT_ID="your_client_ID"
SPOTIFY_CLIENT_SECRET="your_client_secret"python py_server.pycd electron-app
npm run electronThis launches:
- Flask server on http://localhost:5000
- React app in Electron pointing to http://localhost:3000
- User clicks Recognize Song.
- React sends a
GETrequest to/recognizeon the Flask backend. - Flask backend:
- Records 5 seconds of audio from the user's microphone.
- Generates a fingerprint using audio processing.
- Matches the fingerprint against stored fingerprints in the database.
- Returns:
- A list of match results (title + confidence score).
- A base64-encoded image showing alignment of matched fingerprint points.
- React displays the match results and renders the plot visually in the UI.
- User pastes a Spotify track link into the input field and clicks Add Song.
- React sends a
POSTrequest to/addwith thespotify_urlin the request body. - Flask backend:
- Extracts the track ID from the Spotify link.
- Fetches track metadata (title, artist, album) using the Spotify API.
- Searches YouTube for an official audio version of the track.
- Downloads the audio using
yt-dlp. - Generates a fingerprint of the audio.
- Stores the fingerprint in the SQLite database.
- Deletes the temporary downloaded audio file.
- User is notified of success or failure through UI alerts.
.
├── electron-app/
│ ├── public/
│ │ └── electron.js # Main Electron process
│ ├── src/
│ │ ├── App.js # React component with UI and logic
│ │ ├── App.css # Tailwind styles
│ │ └── index.js # App entry point
│ └── tailwind.config.js # Tailwind customization
├── py_server.py # Flask backend
└── src/
├── mic_record.py # Audio recording
├── generate_fingerprint.py # Generate audio fingerprints
├── match.py # Match fingerprints
└── plot.py # Plot match alignment as base64 image
└── spotify_handler.py # fetches the song metadata from the spotify link using spotify Web API
└── youtube_handler.py # downloads the audio from web usng yt_dl
In electron-app/:
npm start # Starts React only
npm run electron # Starts both React and Electron in parallel- Visualizes matching points between input and stored tracks.
- Rendered using
matplotlib, sent as base64 string to frontend and shown in<img />.
Flask backend has CORS enabled for smooth communication between Electron (localhost:3000) and Flask (localhost:5000).
also Let the user get the audio from the device they are using
- Fingerprint generation and matching logic assumed to be implemented in custom modules under
src/. - App supports hot-reloading for React changes.
- Uses Tailwind dark mode via
class="dark"in HTML.