MelodAI is a karaoke application that lets users search for songs, download them, split audio into vocals and instrumentals, and display synchronized lyrics. The project consists of a Flask backend and a JavaScript/HTML frontend.
- Song Search: Search for songs using Deezer's API
- Audio Processing: Downloads, splits audio (vocals/instrumentals), and extracts lyrics with AI models
- Real-time Lyrics: Displays synchronized lyrics that highlight along with playback
- Playback Controls: Allows volume adjustments for vocals and music, progress control, and queue management
- User Authentication: Secure login system with password reset and "Remember Me" functionality
- Dark Mode: Supports light and dark theme
- Shareable Links: Share songs via URLs (e.g., http://localhost:5000/#song=3122055081)
- Queue Management: Add multiple songs to queue and manage playback order
- Random Song: Play a random song from your processed collection
- Python 3.10+
- Deezer ARL Token
- Replicate API Token
- Hugging Face Access Token (read-only)
- SMTP Server (for password reset emails)
-
Clone the repo and install dependencies:
git clone <repo-url> cd melodai # Optional: Setup virtual environment python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate # Install requirements pip install -r requirements.txt
-
Add environment variables in a
.env
file:HF_READ_TOKEN=<Your Hugging Face Token> REPLICATE_API_TOKEN=<Your Replicate Token> DEEZER_ARL=<Your Deezer ARL Token> # SMTP Configuration for Password Reset (optional, untested) SMTP_HOST=smtp.example.com SMTP_PORT=587 [email protected] SMTP_PASSWORD=your-password BASE_URL=http://localhost:5000
-
Start the backend:
python main.py
-
Open
http://localhost:5000
in your browser
Prerequisites: Docker installed
docker compose up
Access the frontend at http://localhost
GET /search?q=<query>
: Search for songs on DeezerGET /add?id=<track_id>
: Process a track (download, split, extract lyrics)GET /track/<track_id>
: Get track metadataPOST /random
: Get a random processed song
POST /auth/login
: Login with username and passwordPOST /auth/register
: Create a new accountPOST /auth/logout
: End the current sessionPOST /auth/forgot-password
: Request a password resetPOST /auth/reset-password
: Reset password with tokenGET /auth/check
: Check authentication status
track_progress
: Real-time processing status updatestrack_ready
: Notification when track processing is completetrack_error
: Error notifications during track processing
- Register an account (and wait for approval) or login (first user is admin)
- Use the search bar to find songs
- Click on a song to add it to your queue
- Control playback with:
- Play/Pause
- Volume adjustments
- Progress control
- Queue management
- Secure password hashing
- Session-based authentication
- Remember me functionality (30-day persistence)
- Password reset via email
- Rate limiting on authentication endpoints
- CSRF protection
- Secure cookie handling
This project is licensed under the MIT License. Enjoy singing with MelodAI! 🎶