A modern, high-fidelity Android music player featuring AI song structure segmentation, smart weighted shuffle, seamless crossfading, offline LiteRT voice controls, dynamic 3x3 playlist collages, and automated CI/CD releases.
Mp3Player gives you complete control over how music is analyzed, segmented, scheduled, and played:
- Harmonized Beat-Synchronous Laplacian Clustering: Uses ISMIR 2014 Beat-Synchronous Laplacian Spectral Clustering + Eigengap heuristic as authoritative ground truth for song macro-structure across all tiers.
- Dual Analysis Tiers:
- π΅ Tier 1 (CPU Spectral AI): Beat tracking, chroma recurrence, and spectral novelty peak-picking on CPU (runs in 1-2s per track).
- π£ Tier 2 (GPU Neural AI): CUDA-accelerated Demucs HDEMUCS v4 source separation for isolated vocal tracks + SpeechBrain ECAPA-TDNN 192-dimensional biometric speaker voiceprints to detect singer transitions.
- Multi-Artist & Singer Isolation:
- Automatically distinguishes between different vocalists (e.g. duet or featured artists).
- Clean two-row preset selector:
- Row 1 (Song Parts):
[ All Parts ],[ Vocals Only ],[ No Intro/Outro ]. - Row 2 (Singers): Dedicated filter chips for each detected vocalist (
[ π€ Artist 1 ],[ π€ Artist 2 ]).
- Row 1 (Song Parts):
- Non-Destructive Playback Control: Skip unwanted intros/outros, isolate specific verses or choruses, or loop single sections in real time without modifying original audio files.
- Preservation of User Cuts: Tracks with existing AI segmentations are never forcibly overwritten. Clickable version badges (
[ β‘ Update v2 ],[ β‘ Upgrade GPU ]) let you voluntarily upgrade tracks on demand.
- Adaptive Track Weighting: Tracks you skip are automatically penalized in future shuffles, while tracks you manually jump to receive an immediate probability boost.
- Manual Likelihood Multipliers: Adjust any song's selection weight from
0.1xto5.0xdirectly from the playlist menu. - Keeper Leaderboard: Detects chain-skipping behavior and logs the song you ultimately settle on as a "Keeper," building a personalized leaderboard of tracks you truly enjoy.
- Sinusoidal Crossfade: Dual ExoPlayer instances calculate smooth volume ramps for gapless, studio-quality track transitions.
- Smart Playback Safety: Automatic short-track duration clamping, corrupted file detection and auto-advance, and repeat-one loop isolation.
- Hardware Equalizer: Built-in 5-band EQ with Bass Boost and virtualizer effect management.
- On-Device Keyword Spotting: Powered by Google LiteRT (TFLite) running local models 100% offline.
-
Biking & Wind Filter: 4th-order Butterworth High-Pass Filter (
$f_c = 150\text{ Hz}$ ) and hardware Acoustic Echo Cancellation (AEC) eliminate wind noise and road rumble. - Supported Commands: "go" (play/resume), "stop" (pause), "right" (next track), "left" (previous track).
- Direct Lock Screen Toggles: Custom
MediaSessionCompatactions and system transport controls let you toggle shuffle and loop modes directly from the lock screen and notification shade without unlocking your phone. - Dynamic Active State: Notification icons reflect current shuffle and repeat states in real time.
- Automated Playlist Collages:
PlaylistCoverManagersorts tracks by play frequency and synthesizes high-contrast 3x3 grid collages featuring the 9 most-played tracks. - Music Video Detector: Detects generic YouTube thumbnails on downloaded tracks and automatically fetches official high-resolution album artwork.
- Pure Studio Audio Filtering: Integrates YouTube Music's official track catalog (
filter="songs") to deliver official studio album masters. Eliminates music video intro skits, cinematic sound effects, and talking. - Artist Discography Explorer: Search any music artist to view their complete official discographyβtop tracks, full studio albums, and singles/EPs.
- 1-Tap Album Downloader: Browse numbered album tracklists and batch download full albums with one tap, automatically tagging album names and high-resolution cover art.
- Modern Tabbed Search UX: Fluid switching between
[ Songs (Studio Audio) ]and[ Artists & Albums ], real-time auto-complete suggestions, and quick-discover popular artist chips.
- 1-Tap Instant Play: Tapping an upcoming thumbnail plays that track immediately while preserving your existing queue.
- Clickable Covers: Tapping the widget's playlist collage cover opens that playlist directly.
- Larger Touch Targets: Enlarged 32x32dp shuffle and loop buttons with a compact progress bar.
- Compose List Virtualization:
LazyColumnuses explicitcontentTypedefinitions to reuse item compositions during fast fling scrolling. - Zero-Overhead Reordering: Physics animations are short-circuited when not actively dragging items, eliminating unnecessary 60/120Hz frame calculations.
- Downscaled Image Decoding: ID3 album art is decoded at target thumbnail resolutions (150x150) without native-resolution decoding, eliminating Davey frame drops and
MediaCodecresource exhaustion.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Android Client (Kotlin) β
β β
β βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ β
β β UI (Jetpack Compose) β β AudioService (Media3) β β
β β - Playlist Virtualizerβ β - Dual ExoPlayer β β
β β - Song Part Selector β β - MediaSessionCompat β β
β β - Full & Mini Player β β - Hardware Equalizer β β
β ββββββββββββββ¬βββββββββββββ ββββββββββββββ¬βββββββββββββ β
β β β β
β ββββββββββββββΌβββββββββββββ ββββββββββββββΌβββββββββββββ β
β β MusicViewModel (Flow) β β LiteRT Voice Engine β β
β β Room Database (v6) β β - 4th-Order Butterworth β β
β β - SongSectionEntity β β - Hardware AEC Filter β β
β ββββββββββββββ¬βββββββββββββ βββββββββββββββββββββββββββ β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββ
β HTTP REST (Retrofit / OkHttp)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FastAPI Backend Service β
β β
β βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ β
β β Tier 1 (CPU Spectral) β β Tier 2 (GPU Neural) β β
β β - Laplacian ISMIR 2014 β β - CUDA Acceleration β β
β β - Eigengap Heuristic β β - Demucs HDEMUCS v4 β β
β β - Librosa & Scipy β β - ECAPA-TDNN Voiceprintβ β
β βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ β
β β yt-dlp & ffmpeg engine β β Mutagen ID3 & Art Tag β β
β βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
This repository includes a GitHub Actions automated release pipeline in .github/workflows/release.yml:
- On Every Push to
main:- Runs the test suite (
./gradlew testDebugUnitTest). - Compiles both Debug and Release APKs (
Mp3Player-Debug.apkandMp3Player-Release.apk). - Uploads the build artifacts to the workflow run.
- Automatically publishes / updates the "Latest Continuous Build" pre-release in the Releases tab so you can immediately download the newest APK to your phone.
- Runs the test suite (
- On Version Tag Push (
git tag v1.x.x && git push origin v1.x.x):- Automatically compiles and publishes an official release with attached APKs and auto-generated release notes.
- Manual Dispatch:
- Run the build and publish workflow manually anytime from the GitHub Actions web interface.
- Visit the Releases page.
- Download
Mp3Player-Release.apk(orMp3Player-Debug.apk) directly on your Android phone. - Tap the file to install (enable "Install Unknown Apps" if prompted).
git clone https://github.com/UlrikTJ/Mp3Player.git
cd Mp3Player
# Run unit tests
./gradlew testDebugUnitTest
# Build Debug and Release APKs
./gradlew assembleDebug assembleReleaseCompiled APKs will be located at:
app/build/outputs/apk/debug/Mp3Player-Debug.apkapp/build/outputs/apk/release/Mp3Player-Release.apk
For music search, YouTube downloading, and Tier 1/Tier 2 AI song segmentation:
cd server
chmod +x setup_ubuntu.sh
./setup_ubuntu.shOr start manually with Uvicorn:
cd server
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000To run as a 24/7 background service on Ubuntu, see the instructions in server/README.md.
This project is licensed under the MIT License - see the LICENSE file for details.