A curated collection of practical AI projects implementing OCR systems, RAG, AI agents, and other AI use cases.
π§ Music Explorer
Powered by Gemini 3 Flash, ask anything about any audio file or YouTube video

Overview
Music Explorer lets you analyze any audio through natural language. Upload a file or paste a YouTube URL, and ask questions: transcribe lyrics, identify instruments, detect emotion, break down track structure, or describe anything you hear. The conversation is multi-turn, so you can keep asking follow-ups without re-uploading.
Gemini 3 Flash handles the audio understanding entirely via the Gemini Files API, no local model and no GPU required.
Features
- Multi-turn chat: ask follow-up questions about the same audio without re-uploading
- YouTube support: paste any YouTube URL to download and analyze the audio automatically
- Five quick-analysis presets: one click to run full description, transcription, emotion analysis, instrument identification, or track structure breakdown
- Timestamp-aware responses: Gemini can reference specific moments in the audio
- Microphone input: record directly in the browser for live audio analysis
- No GPU needed: runs entirely through the Gemini API
What You Can Ask
- "Describe this track: genre, tempo, key, instruments, and mood"
- "Transcribe the lyrics with timestamps"
- "What emotion does this convey? Does it shift throughout?"
- "List every instrument and when each one enters"
- "Break down the structure (intro, verse, chorus) with timestamps"
- "What language is being spoken?"
- "Summarize what's being said in this podcast clip"
- "What chord progression is used in the chorus?"
Tech Stack
| Layer | Technology |
|---|---|
| Model | Gemini 3 Flash (gemini-3-flash-preview) via Gemini API |
| Audio upload | Gemini Files API |
| YouTube download | yt-dlp + ffmpeg |
| UI | Gradio |
| SDK | google-genai |
Prerequisites
- Python 3.10 or higher
- uv (recommended) or pip
- A Gemini API key
- ffmpeg installed on your system (required for YouTube audio extraction)
Install ffmpeg:
# macOS
brew install ffmpeg
# Ubuntu / Debian
sudo apt install ffmpeg
# Windows
winget install ffmpeg
Installation
1. Clone the Repository
git clone https://github.com/Sumanth077/Hands-On-AI-Engineering.git
cd Hands-On-AI-Engineering/audio/music_explorer
2. Set Up Environment Variables
cp .env.example .env
Add your Gemini API key:
GEMINI_API_KEY=your_gemini_api_key_here
Get your key at aistudio.google.com.
3. Install Dependencies
uv sync
Usage
uv run python app.py
Navigate to http://localhost:7860.
- Upload an audio file or paste a YouTube URL and click Load YouTube Audio
- Type a question or click a Quick Analysis preset
- Keep asking follow-ups: the conversation is multi-turn, no need to re-upload
How It Works
Audio file / YouTube URL
β
βΌ
yt-dlp (YouTube only) β downloads audio as MP3
β
βΌ
Gemini Files API β uploads audio, returns a file reference
β
βΌ
Gemini 3 Flash β multi-turn conversation with audio context
β
βΌ
Streamed response β transcription Β· analysis Β· timestamps Β· description
Project Structure
music_explorer/
βββ app.py # Gradio UI and Gemini inference logic
βββ assets/
β βββ demo.gif # App demo
βββ .env.example # API key template
βββ pyproject.toml # Dependencies (uv)
βββ README.md
Notes
- Uploaded files are stored temporarily in the Gemini Files API for up to 48 hours
- YouTube audio is cached locally for the session to avoid repeat downloads
- For best results, use audio files under 20 MB
License
This project is licensed under the MIT License. See the LICENSE file for details.