← all projects
Personal Project · 1 min read
Voice Synthesis REST API
A standalone Flask microservice that exposes text-to-speech as a single, reusable REST endpoint.
~/voice-synthesis-api/architecturesynchronous · single endpoint · warm model process
Problem
- The XTTS-v2 text-to-speech engine was originally embedded inside the media pipeline — useful there, but unusable by anything else without duplicating the model-loading code.
Architecture
- A Flask microservice with a single REST endpoint: accepts text input, runs it through the XTTS-v2 model, returns synthesized speech.
- Model loading and inference are isolated from any caller-specific logic, keeping the service generic.
Engineering Decisions
- Decoupled the TTS engine from the main content pipeline into an independently callable service, so any future project can call the same endpoint instead of re-implementing voice synthesis.
Challenges
- Balancing model load time against request latency in a synchronous Flask service — informed how the service is intended to be run (warm process, not cold-started per request).
Lessons Learned
- Extracting a single well-defined capability into its own service made it directly reusable — the same pattern is a natural next step for the transcription stage too.