Skip to content

A Python-based gesture recognition system that integrates OpenCV, MediaPipe, and Spotify Web API for touchless music playback control.

Notifications You must be signed in to change notification settings

SnigdhaSarkar16/Spotify-Gesture-Controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽต Spotify Gesture Controller

Control your Spotify playback using hand gestures with OpenCV, MediaPipe, and the Spotify Web API.

Use your webcam to:

  • โœ‹ Play
  • โœŠ Pause
  • ๐Ÿ‘‰ Next / Previous track
  • ๐Ÿ” Replay
  • ๐Ÿ”Š Control volume by changing thumbโ€“index distance
  • ๐Ÿ“€ Watch a rotating vinyl disc made from album art
  • ๐ŸŽš View a vertical volume slider + Spotify-like progress bar

๐Ÿ“ธ Screenshots


โœจ Features

  • ๐Ÿ“€ Rotating vinyl disc created from Spotify album art
  • ๐ŸŽถ Real-time progress bar synced with song progress
  • ๐Ÿ– Gesture-based playback control
  • ๐ŸŽš Vertical volume bar
  • ๐ŸŽจ Custom UI overlay designed inside OpenCV
  • โš™๏ธ Full integration with Spotify Web API (requires Premium for some features)

๐Ÿ›  Technologies Used

Technology Purpose
Python Core language
OpenCV Drawing UI + capturing webcam frames
MediaPipe Real-time hand landmark tracking
Spotipy Sending playback commands to Spotify
Pillow (PIL) Image processing for vinyl disc
NumPy Fast math operations
python-dotenv Loading Spotify API keys from .env

๐Ÿš€ Setup Instructions

1๏ธโƒฃ Clone the Repository git clone https://github.com/YOUR_USERNAME/spotify-gesture-controller.git cd spotify-gesture-controller

2๏ธโƒฃ Create Virtual Environment python -m venv venv venv\Scripts\activate # Windows

3๏ธโƒฃ Install Dependencies pip install -r requirements.txt

4๏ธโƒฃ Create a .env File for Spotify Credentials Create a file named .env inside the project folder:

SPOTIPY_CLIENT_ID=your_client_id_here

SPOTIPY_CLIENT_SECRET=your_client_secret_here

SPOTIPY_REDIRECT_URI=http://127.0.0.1:8888/callback

Get these values from: ๐Ÿ‘‰ https://developer.spotify.com/dashboard

5๏ธโƒฃ Run the App python spotify_controller.py

Your webcam window will open and start detecting gestures.

๐ŸŽฎ Gesture Controls (Cheat Sheet) Gesture Action

Gesture Action
โœ‹ Open Palm Play
โœŠ Fist Pause
โ˜๏ธโœŒ๏ธ Index + Middle extended Next track
๐Ÿ‘โ˜๏ธโœŒ๏ธ Thumb + Index + Middle Previous track
๐ŸคŸ Ring + Pinky Replay
๐Ÿ‘โ˜๏ธ Thumbโ€“Index distance Volume control

๐ŸŽจ UI Showcase

๐Ÿ“€ Rotating vinyl disc with album art

โž• Center control buttons (Play/Pause/Next/Previous/Replay)

๐Ÿ“Š Spotify-style progress bar

๐Ÿ”Š Vertical volume slider

๐Ÿ‘‹ Live hand landmark overlay

๐Ÿ“ Project Structure spotify-gesture-controller/

โ”‚

โ”œโ”€โ”€ spotify_controller.py

โ”œโ”€โ”€ requirements.txt

โ”œโ”€โ”€ README.md

โ”œโ”€โ”€ .gitignore

โ””โ”€โ”€ .env (ignored in GitHub)

๐Ÿงฉ Possible Future Improvements Add pinch-to-seek progress control Custom Spotify-themed UI skin Hand tracking with ML model instead of rule-based detection Multiple gesture modes (simple / advanced)

๐Ÿ“ License

MIT License.

IF YOU LIKE THIS PROJECT GIVE IT A STAR ON GITHUB WOULD MEAN A LOT THANKYOU!!!!

About

A Python-based gesture recognition system that integrates OpenCV, MediaPipe, and Spotify Web API for touchless music playback control.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages