This project provides a fun and interactive vinyl record player interface for Spotify. Spin the record, scratch for sound effects, and control playback directly from the GUI.
For detailed instructions on assembling the physical record player enclosure, wiring diagrams, and parts list, please refer to:
- Concept Bytes: https://concept-bytes.com (Search for “Spotify Record Player”)
- Patreon: https://patreon.com/ConceptBytes
- Real-time display of currently playing track, artist, and album art
- Vinyl record spin animation with realistic speed
- Scratch sound effects via swipe gesture
- Playback controls: play/pause, skip forward, skip back
- Random vinyl artwork selection from the
records/directory
- Python 3.7+
- pip
- Spotify Premium account
- A registered Spotify application (Client ID and Client Secret)
Python dependencies:
pip install pygame requests spotipyThis application uses environment variables for Spotify authentication and settings.
It automatically loads values from a .env file in the project root (if present).
Required variables:
SPOTIFY_CLIENT_ID: Your Spotify application Client ID.SPOTIFY_CLIENT_SECRET: Your Spotify application Client Secret.SPOTIFY_USERNAME: Your Spotify username.
Optional variables (with defaults):
SPOTIFY_REDIRECT_URI(default:http://localhost:8888/callback)SPOTIFY_SCOPE(default:user-read-currently-playing)
To configure, create a .env file in the project root with:
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret
SPOTIFY_USERNAME=your_spotify_username
SPOTIFY_REDIRECT_URI=http://localhost:8888/callback
SPOTIFY_SCOPE=user-read-currently-playingOr export them in your shell:
export SPOTIFY_CLIENT_ID=your_client_id
export SPOTIFY_CLIENT_SECRET=your_client_secret
export SPOTIFY_USERNAME=your_spotify_username
export SPOTIFY_REDIRECT_URI=http://localhost:8888/callback
export SPOTIFY_SCOPE=user-read-currently-playingOn first run, if any required variables are missing, the app will prompt you to enter them,
and save them to .env for future use.
Run the application from the command line:
-
Fullscreen mode (default):
python main.py
-
Windowed mode:
python main.py --windowed
Press ESC to exit.
- Click and drag on the vinyl record to spin manually.
- Swipe on the record for a scratch effect.
- Click the on-screen buttons:
- ◄ (Previous track)
- ▶/⏸ (Play/Pause)
- ► (Next track)
To use this project with your Raspberry Pi as a Spotify Connect device, install Raspotify:
-
Update packages and install:
sudo apt update sudo apt install raspotify
Or run the official installer:
curl -sL https://dtcooper.github.io/raspotify/install.sh | sh -
(Optional) Edit the configuration at
/etc/raspotify/configto customize:sudo nano /etc/raspotify/config
For example, set:
DEVICE_NAME="My Spotify Pi" BITRATE="160" -
Restart the service:
sudo systemctl restart raspotify
-
In your Spotify app, select your Raspberry Pi (e.g., "raspotify") as the playback device.
Now your Raspberry Pi will appear as a Spotify Connect device.
Built by Concept Bytes. Learn more at https://concept-bytes.com or support on Patreon at https://patreon.com/ConceptBytes.