Emotion Player is an intelligent Android music discovery engine that bridges the gap between environmental sensors and Spotify playback. It uses a custom VibePipeline to translate physical gestures, real-time weather, and historical "Soul Profile" data into perfect musical matches.
The app doesn't just search for genres; it executes a multi-stage Aggressive Pooling strategy to ensure a 0% failure rate in music discovery.
Combines multi-modal data into a unified "Emotion Vector":
-
Gesture Analysis: Calculates motion intensity using distance vectors (
$\sqrt{dx^2 + dy^2}$ ) and touch pressure. - Weather Integration: Maps 50+ weather conditions (from OpenWeather) to psychological states (e.g., Haze → Fearful, Spring → Joyful).
- Temporal Bias: Adjusts music suggestions based on time-of-day (e.g., 5 AM - 8 AM → Hopeful).
The "Soul Profile" (soul_profile.json) tracks your emotional affinity:
- Dynamic Weighting: Every Skip or Like adjusts the 32-emotion weight map.
- Audio Feature Learning: Uses Spotify's
valence,energy, andtempofeatures to retroactively update your profile based on what you actually listen to.
To prevent empty playlists, the pipeline uses a 4-tier fallback:
- Primary Match: High-popularity tracks from the top-scored emotion.
- Genre Expansion: If the pool is < 20, it expands via genre-specific Spotify searches.
- Secondary Injection: Pulls from the next two most likely emotions.
- Absolute Safety: Uses a broad "Year: 2024" discovery pool to ensure the music never stops.
The app features a RandomRotatedGestureSwipeHint system that uses procedural path generation on a Compose Canvas:
- Geometric Paths: Includes math-heavy implementations for Infinity (Lemniscate of Bernoulli), Archimedean Spirals, and Sinusoidal Waves.
- Material 3: A dark-themed, immersive UI using Jetpack Compose and Coil for asynchronous image loading.
VID_20260617_223644.mp4
- Language: 100% Kotlin
- UI: Jetpack Compose (Animations, Canvas, Material 3)
- Networking: OkHttp3, Retrofit, GSON
- APIs: Spotify (App Remote + Web API), OpenWeatherMaps
- Location: Google Play Services (FusedLocationProvider)
- Conscurrency: Kotlin Coroutines & Flow
- Clone the Repo:
git clone https://github.com/vizansh/Emotion-Player.git - API Keys: Create a
local.propertiesfile in the root directory and add your credentials: - Requirements: ◦The official Spotify app must be installed and logged in on the device. ◦GPS must be enabled for the WeatherModule to sync the vibe. ◦Android Studio Ladybug (2024.2.1+) is recommended.
- Spotify App Remote: Ensure the official Spotify app is installed on your device, as this project utilizes the Spotify App Remote SDK for playback control.
- Build: Open in Android Studio (Ladybug 2024.2.1 or newer) and sync Gradle.
- Android: download the .apk to play on android.
Developed by Vansh — Where Code, Climate, and Chords Collide.