How onkarwakchaure/text-to-speech-ai works
Text To Speech AI is a FastAPI web app for generating English and Hindi speech, with either a built-in voice or an uploaded voice sample for cloning. The main workflow is browser form → /generate → optional MP3-to-WAV input conversion → XTTS synthesis → WAV-to-MP3 output → browser playback or download. The README also documents temporary-file cleanup and the static web interface. The source excerpt is limited to main.py; UI behavior beyond the documented capabilities is not inferred.
Main entry points: main.py FastAPI app · index.html Web interface · static Static assets
Components 15
Web interface
- Web interface
templates/index.html - Static assets
static - Playback and download
templates/index.html
Speech API
- FastAPI app
main.py - Speech request
main.py - XTTS v2
main.py
Audio processing
- Voice sample
main.py - MP3 to WAV
main.py - Speech synthesis
main.py - WAV to MP3
main.py - Pydub and FFmpeg
main.py
Audio files
- Uploaded audio
main.py - Temporary WAV
main.py - Generated MP3
main.py
Other components
- User
Connections 19
- User → Web interface: uses
README.md - Web interface → FastAPI app: submits request
README.md - FastAPI app → Web interface: serves page
main.py - FastAPI app → Static assets: mounts assets
main.py - FastAPI app → Speech request: routes generation
main.py - Speech request → Uploaded audio: writes upload
main.py - Speech request → Voice sample: selects sample
main.py - Uploaded audio → MP3 to WAV: reads MP3
main.py - MP3 to WAV → Pydub and FFmpeg: converts audio
main.py - MP3 to WAV → Voice sample: produces WAV
main.py - Speech request → Speech synthesis: invokes
main.py - Voice sample → Speech synthesis: conditions voice
main.py - Speech synthesis → XTTS v2: calls XTTS
main.py - Speech synthesis → Temporary WAV: writes WAV
main.py - Temporary WAV → WAV to MP3: reads WAV
main.py - WAV to MP3 → Pydub and FFmpeg: converts audio
main.py - WAV to MP3 → Generated MP3: writes MP3
main.py - Generated MP3 → Playback and download: serves audio
README.md - Playback and download → User: plays or downloads
README.md