# seek-tune — Song Recognition Algorithm in Go > An open-source implementation of the Shazam audio fingerprinting algorithm written in Go, capable of identifying songs from short audio samples. ## Install Save as a script file and run: # seek-tune — Song Recognition Algorithm in Go ## Quick Use ```bash go install github.com/cgzirim/seek-tune@latest # Index songs from a directory seek-tune index --dir ./music # Identify a song from a recording seek-tune recognize --file sample.wav ``` ## Introduction seek-tune is an open-source Go implementation of the audio fingerprinting algorithm popularized by Shazam. It generates spectral fingerprints from audio files, stores them in a local database, and matches recorded audio samples against the fingerprint catalog. Developers use it to build song recognition features without relying on commercial APIs. ## What seek-tune Does - Generates compact audio fingerprints from music files - Indexes fingerprints in a local database for fast lookup - Matches short audio recordings against the indexed catalog - Handles noisy recordings and partial matches - Supports common audio formats including WAV, MP3, and FLAC ## Architecture Overview The algorithm extracts a spectrogram from each audio file using FFT, then identifies peak frequencies as constellation points. Pairs of nearby peaks form hashes that are stored in a hash table keyed by frequency pair and time delta. Recognition works by fingerprinting the query audio the same way and looking up matching hashes, then verifying temporal alignment to confirm the match. ## Self-Hosting & Configuration - Install via go install or build from source - Index your music collection using the index command - Store fingerprints in a local SQLite or PostgreSQL database - Configure FFT window size and peak detection thresholds for accuracy tuning - Run as a standalone CLI or embed the library in a Go application ## Key Features - Recognizes songs from recordings as short as 5 seconds - Noise-tolerant matching that works with ambient recordings - Concurrent indexing for fast catalog building - Embeddable Go library for integration into other applications - No external API dependencies or subscriptions required ## Comparison with Similar Tools - **Shazam** — Commercial service; seek-tune is open-source and self-hosted - **Chromaprint/AcoustID** — Fingerprinting for identification lookup; seek-tune includes the full matching pipeline - **dejavu** — Python implementation of audio fingerprinting; seek-tune is in Go with better concurrency - **audd.io** — Music recognition API; seek-tune runs locally with no API costs ## FAQ **Q: How large a music library can it handle?** A: It scales to tens of thousands of songs. Fingerprint lookup is O(1) via hash table. **Q: Does it work with streaming audio?** A: You can pipe audio from a microphone or stream into the recognition command. **Q: What audio formats are supported?** A: WAV, MP3, FLAC, and any format supported by the underlying audio decoder. **Q: Can I use it as a library in my Go project?** A: Yes. The core fingerprinting and matching functions are exported as a Go package. ## Sources - https://github.com/cgzirim/seek-tune --- Source: https://tokrepo.com/en/workflows/asset-b63100f5 Author: Script Depot