This project is a mood-based music player developed as an undergraduate project at the Department of Electrical & Computer Engineering, University of Peloponnese for the course "Digital Sound and Image Processing." The project was performed by Kalogeropoulos A. and Andrikou D., under the supervision of Associate Prof. Athanasios Koutras.
The Mood-Based Playlist Generator creates music playlists based on the user's mood using Spotify's API. It classifies songs into 16 different mood states based on their audio features such as valence (positivity) and arousal (energy level), and generates mood-specific playlists. The project includes the following functionalities:
- Audio Feature Extraction: Retrieves audio features from Spotify to classify tracks by mood.
- Mood Classification: Uses valence and arousal values to classify tracks into 16 mood categories, including happy, sad, energetic, relaxed, and more.
- Playlist Creation: Automatically generates mood-specific playlists on Spotify.
- Playback Control: Allows users to play, pause, and skip tracks, as well as view detailed track information.
- Visualization: Displays graphical representations of the distribution of songs across moods and valence-arousal mapping.
- Automatic mood classification of songs based on audio features
- Creation of playlists tailored to specific moods
- Real-time playback monitoring and control
- Saving and exporting playlists and audio features to CSV files
- Visualizations of mood distributions and valence-arousal maps
To run this project, the following dependencies must be installed:
- Python 3.7 or higher
spotipyfor Spotify API interactionmatplotlibfor visualizationnumpyfor numerical operationstqdmfor progress barstermcolorfor colored terminal output
You will also need to set up a Spotify Developer account and obtain the following:
- Client ID and Client Secret for the Spotify API
- Redirect URI for OAuth authentication
-
Install Python Dependencies:
pip install spotipy matplotlib numpy tqdm termcolor -
Configure Spotify API Credentials:
- Replace the placeholder values for
CLIENT_ID,CLIENT_SECRET, andREDIRECT_URIin the code with your Spotify developer account credentials.
- Replace the placeholder values for
-
Run the Application:
python moodplaylist.py- The program will guide you through the steps for selecting a mood, creating a playlist, and starting playback.
- Ensure you have an active Spotify account and that the device you want to play music on is available for playback.
- The application requires a network connection to access the Spotify API and download track information.
- Visualizations will be saved as PNG files in the current working directory.
This project is intended for educational purposes and should not be used for commercial applications without proper licensing.