# 🚀 DĂ©marrage Rapide - Audio Classifier ## En 5 minutes ### 1. Configuration initiale ```bash cd "/Users/benoit/Documents/code/Audio Classifier" # Copier les variables d'environnement cp .env.example .env # IMPORTANT : Éditer .env et dĂ©finir votre chemin audio # AUDIO_LIBRARY_PATH=/Users/benoit/Music nano .env ``` ### 2. TĂ©lĂ©charger les modĂšles d'IA ```bash ./scripts/download-essentia-models.sh ``` Cela tĂ©lĂ©charge ~300 MB de modĂšles Essentia pour la classification. ### 3. Lancer le backend ```bash docker-compose up -d ``` VĂ©rifier : http://localhost:8000/health ### 4. Analyser votre bibliothĂšque ```bash # Analyser un dossier (remplacer par votre chemin) curl -X POST http://localhost:8000/api/analyze/folder \ -H "Content-Type: application/json" \ -d '{"path": "/audio", "recursive": true}' # Note: "/audio" correspond Ă  AUDIO_LIBRARY_PATH dans le conteneur ``` Vous recevrez un `job_id`. Suivre la progression : ```bash curl http://localhost:8000/api/analyze/status/VOTRE_JOB_ID ``` ### 5. Lancer le frontend ```bash cd frontend cp .env.local.example .env.local npm install npm run dev ``` Ouvrir : http://localhost:3000 ## 📊 Exemples d'utilisation ### Rechercher des pistes ```bash # Par texte curl "http://localhost:8000/api/search?q=jazz" # Par genre curl "http://localhost:8000/api/tracks?genre=electronic&limit=10" # Par BPM curl "http://localhost:8000/api/tracks?bpm_min=120&bpm_max=140" # Par ambiance curl "http://localhost:8000/api/tracks?mood=energetic" ``` ### Trouver des pistes similaires ```bash # 1. RĂ©cupĂ©rer un track_id curl "http://localhost:8000/api/tracks?limit=1" # 2. Trouver des similaires curl "http://localhost:8000/api/tracks/TRACK_ID/similar?limit=10" ``` ### Statistiques ```bash curl "http://localhost:8000/api/stats" ``` ### Écouter / TĂ©lĂ©charger - Stream : http://localhost:8000/api/audio/stream/TRACK_ID - Download : http://localhost:8000/api/audio/download/TRACK_ID ## 🎯 Ce qui est analysĂ© Pour chaque fichier audio : ✅ **Tempo** (BPM) ✅ **TonalitĂ©** (C major, D minor, etc.) ✅ **Genre** (50 genres : electronic, jazz, rock, etc.) ✅ **Ambiance** (56 moods : energetic, calm, dark, etc.) ✅ **Instruments** (40 instruments : piano, guitar, drums, etc.) ✅ **Énergie** (score 0-1) ✅ **Danceability** (score 0-1) ✅ **Valence** (positivitĂ© Ă©motionnelle) ✅ **Features spectrales** (centroid, zero-crossing, etc.) ## ⚡ Performance **Sur CPU moderne (4 cores)** : - ~2-3 secondes par fichier - Analyse parallĂšle (4 workers par dĂ©faut) - 1000 fichiers ≈ 40-50 minutes **Pour accĂ©lĂ©rer** : Ajuster `ANALYSIS_NUM_WORKERS` dans `.env` ## 📁 Structure ``` Audio Classifier/ ├── backend/ # API Python + analyse audio ├── frontend/ # Interface Next.js ├── scripts/ # Scripts utilitaires ├── .env # Configuration └── docker-compose.yml ``` ## 🔍 Endpoints Principaux | Endpoint | MĂ©thode | Description | |----------|---------|-------------| | `/api/tracks` | GET | Liste des pistes | | `/api/tracks/{id}` | GET | DĂ©tails piste | | `/api/search` | GET | Recherche textuelle | | `/api/tracks/{id}/similar` | GET | Pistes similaires | | `/api/analyze/folder` | POST | Lancer analyse | | `/api/audio/stream/{id}` | GET | Streaming audio | | `/api/audio/download/{id}` | GET | TĂ©lĂ©charger | | `/api/stats` | GET | Statistiques | Documentation complĂšte : http://localhost:8000/docs ## 🐛 ProblĂšmes Courants **"Connection refused"** ```bash docker-compose ps # VĂ©rifier que les services sont up docker-compose logs backend # Voir les erreurs ``` **"Model file not found"** ```bash ./scripts/download-essentia-models.sh ls backend/models/*.pb # VĂ©rifier prĂ©sence ``` **Frontend ne charge pas** ```bash cd frontend cat .env.local # VĂ©rifier NEXT_PUBLIC_API_URL npm install # RĂ©installer dĂ©pendances ``` ## 📚 Documentation ComplĂšte - **[README.md](README.md)** - Vue d'ensemble du projet - **[SETUP.md](SETUP.md)** - Guide dĂ©taillĂ© d'installation et configuration - **[.claude-todo.md](.claude-todo.md)** - DĂ©tails techniques d'implĂ©mentation ## đŸŽ” Formats SupportĂ©s ✅ MP3 ✅ WAV ✅ FLAC ✅ M4A ✅ OGG ## 💡 Prochaines Étapes 1. **Analyser votre bibliothĂšque** : Lancer l'analyse sur vos fichiers 2. **Explorer l'interface** : Naviguer dans les pistes analysĂ©es 3. **Tester la recherche** : Filtrer par genre, BPM, mood 4. **DĂ©couvrir les similaires** : Trouver des recommandations Enjoy! đŸŽ¶