Skip to content

Repository files navigation

Shaben

A Python Shazam-style audio recognition project. It includes a socket server, a Tkinter desktop client, user authentication, catalog management, and audio fingerprinting for matching recorded snippets against a local song database.

Features

  • Desktop client for recording audio and viewing recognition results
  • Socket server for login, registration, recognition, and admin commands
  • SQLite-backed user, song, and fingerprint storage
  • Admin tools for importing songs and editing catalog metadata
  • Audio fingerprinting and comparison pipeline
  • Configurable host, port, and database path through environment variables

Requirements

  • Python 3.10 or newer
  • PortAudio/PyAudio support on your system
  • Python packages listed in requirements.txt

Installation

git clone https://github.com/benbop/Shaben.git
cd Shaben
python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt

On Windows PowerShell:

git clone https://github.com/benbop/Shaben.git
cd Shaben
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt

Running

Start the server:

python server.py

In another terminal, start the client:

python client.py

By default, the server listens on port 65432. The client connects to 127.0.0.1:65432.

Default Accounts

When the database is initialized, default users are created if no users exist:

  • Admin: admin / admin123
  • User: listener / listener123

You can override these defaults with environment variables before starting the server:

export SHAZAM_ADMIN_USERNAME="admin"
export SHAZAM_ADMIN_PASSWORD="change-me"
export SHAZAM_USER_PASSWORD="listener-password"

Useful Environment Variables

  • SHAZAM_DB_PATH - path to the SQLite database file
  • HOST and PORT - client connection target
  • SERVER_HOST and CHAT_HOST - server host/port configuration used by the app

Project Structure

  • server.py - socket server and command handling
  • client.py - Tkinter desktop client
  • pg_db.py - SQLite database setup and authentication helpers
  • ingest_catalog.py - import songs into the catalog
  • backend/ - fingerprinting, spectrogram, peak detection, and comparison code
  • protocol.py - message packing and JSON helpers

License

Apache-2.0

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages