A powerful, Rust-based audio fingerprinting and recognition system that can identify songs, build music libraries, and provide real-time audio analysis capabilities. Built with modern web technologies and a robust Rust backend.
- π΅ Overview
- β¨ Features
- π οΈ Tech Stack
- π¦ Installation
- π Usage
- π‘ API Reference
- ποΈ Project Architecture
- π§ͺ Development
- π€ Contributing
- π License
- π― Roadmap
- π Contact & Support
Acousti-Scan RS is a comprehensive audio fingerprinting solution that combines the performance of Rust with the flexibility of a modern web interface. The system can analyze audio files, create unique fingerprints, and match unknown audio against a database of known songs. It features both a web-based client interface and a REST API for programmatic access.
The project implements Shazam-like functionality using advanced signal processing techniques including spectrograms, peak detection, and hash-based fingerprinting algorithms.
- π― Audio Identification: Identify songs from audio files or recordings with high accuracy
- π Library Management: Build and maintain a comprehensive music database
- π€ Real-time Recognition: Process live audio input for instant song identification
- π Audio Analysis: Generate spectrograms and analyze audio characteristics
- π YouTube Integration: Automatic metadata fetching and YouTube ID resolution
- βοΈ Spotify Integration: Download and process songs directly from Spotify URLs
- β‘ High Performance: Rust-powered backend for optimal processing speed
- π REST API: Complete HTTP API for integration with external applications
- πΎ SQLite Database: Lightweight, embedded database for fingerprint storage
- π¨ Modern UI: React-based web interface with responsive design
- π± Mobile Support: Touch-friendly interface optimized for mobile devices (Upcoming)
- π Real-time Processing: WebSocket support for live audio (Upcoming)
- FFT Analysis: Fast Fourier Transform for frequency domain analysis
- Peak Detection: Advanced algorithms for identifying spectral peaks
- Fingerprint Generation: Robust hash-based audio fingerprinting
- Multi-format Support: MP3, WAV, FLAC, and other common audio formats
- Noise Resilience: Handles compressed and noisy audio inputs
- Tokio - Asynchronous runtime
- Actix Web - HTTP server framework
- SQLite - Embedded database
- FFmpeg - Audio processing and conversion
- Serde - Serialization framework
- Reqwest - HTTP client
- Next.js 14 - React framework
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Headless UI components
- Lucide Icons - Modern icon library
- Custom Shazam Algorithm - Proprietary fingerprinting implementation
- Spectrogram Analysis - Time-frequency domain processing
- Peak Extraction - Constellation map generation
- Hash Fingerprinting - Robust audio signatures
Ensure you have the following installed:
- Rust (1.70 or higher) - Install Rust
- Node.js (18 or higher) - Install Node.js
- FFmpeg - Audio processing library
- SQLite - Database engine
macOS:
brew install ffmpegUbuntu/Debian:
sudo apt update
sudo apt install ffmpegWindows: Download from FFmpeg official website
# Clone the repository
git clone https://github.com/yourusername/acousti-scan-rs.git
cd acousti-scan-rs
# Build the Rust backend
cargo build --release
# Setup the frontend
cd client
npm install
# or
pnpm installThe application will automatically create the SQLite database on first run:
# Create necessary directories
mkdir -p songs tmp
# Initialize the database (automatic on first API call)
cargo run --release api-server- Start the Backend API Server
# Start the Rust API server (default: localhost:8080)
cargo run --release api-server
# Or specify custom host and port
cargo run --release api-server 0.0.0.0 3001- Start the Frontend Development Server
cd client
npm run dev
# or
pnpm devThe web interface will be available at http://localhost:3000
The application provides several CLI commands for direct interaction:
# Identify a song from an audio file
cargo run --release find path/to/audio.wav# Add a single song (with automatic YouTube ID lookup)
cargo run --release save path/to/song.mp3
# Add a song without YouTube ID requirement
cargo run --release save -f path/to/song.mp3
# Add all songs in a directory
cargo run --release save path/to/music/directory/# Download and add a song from Spotify URL
cargo run --release download "https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC"# Clear the entire database
cargo run --release erase- Song Identification
- Library Management
- Access the Library tab to view all stored songs
- Search and filter through your music collection
- Play preview clips and access YouTube links

- Contributing Songs
- Use the Contribute tab to add new songs
- Upload audio files or provide Spotify URLs
- System automatically extracts metadata and creates fingerprints

The system follows this processing pipeline:
- Audio Input β File upload or microphone recording
- Format Conversion β Convert to WAV using FFmpeg
- Spectrogram Generation β Create time-frequency representation
- Peak Detection β Identify prominent frequency peaks
- Fingerprint Creation β Generate hash-based signatures
- Database Storage/Matching β Store or compare against existing fingerprints
The system provides a comprehensive REST API for programmatic access:
POST /api/find
Content-Type: multipart/form-data
# Form data:
file: [audio file binary]
Response:
[
{
"song_id": 123,
"song_title": "Bohemian Rhapsody",
"song_artist": "Queen",
"youtube_id": "fJ9rUzIMcZQ",
"timestamp": 45000,
"score": 892.5
}
]GET /api/library
Response:
[
{
"id": 1,
"name": "Bohemian Rhapsody",
"artist": "Queen",
"youtube_id": "fJ9rUzIMcZQ",
"thumbnail_url": "https://img.youtube.com/vi/fJ9rUzIMcZQ/maxresdefault.jpg"
}
]POST /api/save?force=true
Content-Type: multipart/form-data
# Form data:
file: [audio file binary]
POST /api/download
Content-Type: application/json
{
"spotify_url": "https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC"
}
DELETE /api/erase
// Identify a song
async function identifySong(audioFile) {
const formData = new FormData();
formData.append('file', audioFile);
const response = await fetch('http://localhost:8080/api/find', {
method: 'POST',
body: formData
});
return response.json();
}
// Get library
async function getLibrary() {
const response = await fetch('http://localhost:8080/api/library');
return response.json();
}import requests
def identify_song(file_path):
with open(file_path, 'rb') as f:
files = {'file': f}
response = requests.post('http://localhost:8080/api/find', files=files)
return response.json()
def get_library():
response = requests.get('http://localhost:8080/api/library')
return response.json()use reqwest::multipart;
async fn identify_song(file_path: &str) -> Result<serde_json::Value, Box<dyn std::error::Error>> {
let file = tokio::fs::File::open(file_path).await?;
let file_part = multipart::Part::stream(file).file_name("audio.mp3");
let form = multipart::Form::new().part("file", file_part);
let client = reqwest::Client::new();
let response = client
.post("http://localhost:8080/api/find")
.multipart(form)
.send()
.await?;
Ok(response.json().await?)
}For complete API documentation, visit the web interface at /api-docs or check out the API Documentation page.
acousti-scan-rs/
βββ src/ # Rust backend source code
β βββ api.rs # REST API endpoints and server
β βββ command_handlers.rs # CLI command implementations
β βββ db/ # Database operations and models
β βββ download/ # Spotify/YouTube integration
β βββ models.rs # Data structures and types
β βββ shazam/ # Audio fingerprinting algorithms
β βββ utils/ # Helper functions and utilities
β βββ wav/ # Audio processing and conversion
β βββ main.rs # Application entry point
βββ client/ # Next.js frontend application
β βββ app/ # Next.js 14 app router pages
β βββ components/ # React components
β βββ lib/ # Utility functions and API client
β βββ styles/ # CSS and styling files
βββ songs/ # Processed audio files storage
βββ tmp/ # Temporary file processing
βββ Cargo.toml # Rust dependencies and metadata
βββ README.md # This file
- main.rs - CLI argument parsing and application entry point
- api.rs - Actix Web server with CORS and multipart file handling
- command_handlers.rs - Business logic for CLI operations
- shazam/ - Core audio fingerprinting algorithms
- db/ - SQLite database operations and schema
- wav/ - Audio file processing and FFmpeg integration
- download/ - External service integrations
- app/ - Next.js pages using the app router
- components/ - Reusable React components
- lib/api.ts - HTTP client for backend communication
- contexts/ - React context providers
Audio Input β FFmpeg Conversion β Spectrogram Analysis β Peak Detection β Fingerprint Generation β Database Storage/Matching β Results Display
# Run Rust backend tests
cargo test
# Run frontend tests
cd client
npm test# Backend with auto-reload
cargo install cargo-watch
cargo watch -x "run --release api-server"
# Frontend with hot reload
cd client
npm run dev# Build optimized Rust binary
cargo build --release
# Build optimized frontend
cd client
npm run build
npm startCreate .env files for configuration:
Backend (.env):
DATABASE_URL=./db.sqlite3
RUST_LOG=info
Frontend (client/.env.local):
NEXT_PUBLIC_API_URL=http://localhost:8080
The SQLite database contains the following main tables:
- songs - Song metadata (title, artist, YouTube ID)
- fingerprints - Audio fingerprint hashes and timing data
- peaks - Spectral peaks for debugging and analysis
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature- Make your changes
- Add tests for new functionality
- Commit your changes
git commit -m 'Add amazing feature'- Push to the branch
git push origin feature/amazing-feature- Open a Pull Request
- Follow Rust conventions and use cargo fmt
- Write tests for new features
- Update documentation for API changes
- Use TypeScript for frontend contributions
- Follow the existing code style
- π Bug Reports: Use the bug report template
- π‘ Feature Requests: Use the feature request template
- π Documentation: Help improve our docs
- π¨ UI/UX: Enhance the user experience
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 Acousti-Scan RS Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
- Multi-language Support - Internationalization
- Cloud Deployment - Docker containers and cloud setup
- Advanced Analytics - Detailed usage statistics and insights
- Playlist Management - Create and manage song collections
- Social Features - Share discoveries and collaborate
- Machine Learning Integration - Improve identification accuracy
- Mobile Apps - Native iOS and Android applications
- Plugin System - Extensible architecture for custom analyzers
- Real-time Streaming - Live radio and streaming service integration
- Enterprise Features - Advanced deployment and management tools
- Primary Maintainer: Ankesh Gupta
- GitHub: @Ankesh2004
- π Bug Reports: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π§ Email: support@acousti-scan.com
- π¬ Discord: Join our Discord Server
- π API Docs: Available at /api-docs when running the application
- π Tutorials: Check out our Wiki
- π Examples: See the examples/ directory
β Star this repo β’ π Report Bug β’ π‘ Request Feature











