cgzirim /seek-tune

An implementation of Shazam's song recognition algorithm.

★ 5,605⑂ 608👁 31⑃ 22● 24▤ 0
GoMITCreated 2024-03-05
-1
日增长
5,605
stars
608
forks
31
watchers
22
prs
24
issues
0
releases

README

SeekTune :musical_note:


  
  



Demo in Video | How it was made (YouTube)

 Description 🎼
SeekTune is an implementation of Shazam's song recognition algorithm based on insights from these resources. It integrates Spotify and YouTube APIs to find and download songs.

 Installation :desktop_computer:
 Prerequisites
- Golang: Install Golang
- FFmpeg: Install FFmpeg
- NPM: Install Node
- YT-DLP: Install YT-DLP

 Steps
📦 Clone the repository:

git clone https://github.com/cgzirim/seek-tune.git
cd seek-tune

 🎧 Spotify API Setup

1. Get credentials: Follow the official getting started guide to create a Spotify app and obtain your Client ID and Client Secret.

2. Configure: Create a .env file in the server directory:
   bash
   SPOTIFY_CLIENT_ID=your-client-id
   SPOTIFY_CLIENT_SECRET=your-client-secret
   

The app will automatically fetch and cache access tokens as needed.


 🐳 Set Up with Docker
Prerequisites: Docker and Docker Compose
1. Build and run the application:
   Bash
   docker-compose up --build
   
   Visit the app at http://localhost:8080
2. To stop the application:
   Bash
   docker-compose down
   

 💻 Set Up Natively
Install dependencies for the backend

cd server
go get ./...

Install dependencies for the client

cd client
npm install


 Usage (Native Setup) :bicyclist:

 ▸ Start the Client App 🏃‍♀️‍➡️ 

 Assuming you're in the client directory:

npm start

 ▸ Start the Backend App 🏃‍♀️ 
In a separate terminal window:

cd server
go run .go serve [-proto  (default: http)] [-port  (default: 5000)]

 ▸ Download a Song 📥 
Note: A link from Spotify's mobile app won't work. You can copy the link from either the desktop or web app.

go run .go download 
  
 ▸ Save local songs to DB (supports all audio formats) 🗃️   

go run .go save [-f|--force] 

The -f or --force flag allows saving the song even if a YouTube ID is not found. Note that the frontend will not display matches without a YouTube ID.  

Note: if .go does not work try to use ./... instead.
  
 ▸ Find matches for a song/recording 🔎

go run .go find 

 ▸ Delete fingerprints and songs 🗑️ 

 Delete only database (default)
go run .go erase
go run .go erase db

 Delete both database and song files
go run .go erase all


 Example :film_projector:  
Download a song 

$ go run .go download https://open.spotify.com/track/4pqwGuGu34g8KtfN8LDGZm?si=b3180b3d61084018
Getting track info...
Now, downloading track...
Fingerprints saved in MongoDB successfully
'Voilà' by 'André Rieu' was downloaded
Total tracks downloaded: 1


Find matches of a song

$ go run .go find songs/Voilà\ -\ André\ Rieu.wav
Top 20 matches:
        - Voilà by André Rieu, score: 5390686.00
        - I Am a Child of God by One Voice Children's Choir, score: 2539.00
        - I Have A Dream by ABBA, score: 2428.00
        - SOS by ABBA, score: 2327.00
        - Sweet Dreams (Are Made of This) - Remastered by Eurythmics, score: 2213.00
        - The Winner Takes It All by ABBA, score: 2094.00
        - Sleigh Ride by One Voi

Top issues

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON