This application allows you to control your Spotify playback using voice commands. It uses the Whisper model for speech recognition and the OpenAI GPT model for command classification.
- Voice control for common Spotify actions (play, pause, skip, etc.)
- Displays currently playing track with album art
- Command history log
- Automatic startup when Spotify is launched
- Python 3.7+
- Spotify Premium account
- Spotify Developer account
- OpenAI API key
-
Clone this repository:
git clone https://github.com/yourusername/voice-controlled-spotify-app.git cd voice-controlled-spotify-app -
Install the required packages:
pip install -r requirements.txt -
Set up your Spotify Developer account and create an app:
- Go to https://developer.spotify.com/dashboard/
- Create a new app
- Add
http://localhost:8888/callbackto the Redirect URIs
-
Create a
.envfile in the project root and add your Spotify and OpenAI credentials:SPOTIPY_CLIENT_ID=your_spotify_client_id SPOTIPY_CLIENT_SECRET=your_spotify_client_secret SPOTIPY_REDIRECT_URI=http://localhost:8888/callback OPENAI_API_KEY=your_openai_api_key
- Start the Spotify desktop app.
- Run the Voice-Controlled Spotify App:
python main.py - Click the microphone button to start listening for commands.
- Speak your command (e.g., "Skip to the next song" or "Pause the music").
To create an executable (.exe) file:
-
Install PyInstaller:
pip install pyinstaller -
Create the executable:
pyinstaller --onefile --windowed main.py -
The executable will be in the
distfolder.
- Create a new repository on GitHub.
- Push your code to the repository.
- Go to the "Releases" section of your GitHub repository.
- Click "Create a new release".
- Tag the version (e.g., v1.0.0).
- Add release notes describing the features and any known issues.
- Attach the packaged .exe file to the release.
- Publish the release.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.