Project Overview
The Emotional TTS system is an advanced text-to-speech engine that generates expressive, emotionally-controlled speech. Built on the IndexTTS2 architecture with a FastAPI backend, it supports 8 emotions, streaming output, and Docker-based deployment.
What is this project?
This project implements an emotional text-to-speech synthesis system for English language. It is developed as part of Phase 1 of the NPC project, focusing on generating speech with controllable emotional characteristics.
The system takes a text input along with emotion control parameters and generates natural-sounding speech that expresses the desired emotion while preserving speaker identity from a short reference audio clip.
Key Features
8 Emotions
Happy, Angry, Sad, Afraid, Disgusted, Melancholic, Surprised, Calm
Two Control Modes
Emotion vector embeddings or reference audio cloning
Real-time Streaming
Stream audio chunks as they are generated
Zero-shot Cloning
Clone any voice with ~5 seconds of reference audio
Batch Processing
Process multiple text-audio pairs in a single job
Docker Ready
Production-ready Docker deployment with GPU support
Technology Stack
| Component | Technology |
|---|---|
| TTS Model | IndexTTS2 |
| Backend Framework | FastAPI (Python 3.10) |
| Deep Learning | PyTorch 2.5.1 + CUDA 12.1 |
| Audio Processing | librosa, soundfile, pydub |
| NLP/Tokenization | transformers, sentencepiece |
| Containerization | Docker (NVIDIA CUDA) |
| API Server | Uvicorn (ASGI) |
Quick Start
cd Docker
docker build -t emotional-tts .
docker run -p 8000:8000 --gpus all emotional-ttscurl http://localhost:8000/health
curl http://localhost:8000/emotionsGPU Recommended