Emotional TTS
Getting Started

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

ComponentTechnology
TTS ModelIndexTTS2
Backend FrameworkFastAPI (Python 3.10)
Deep LearningPyTorch 2.5.1 + CUDA 12.1
Audio Processinglibrosa, soundfile, pydub
NLP/Tokenizationtransformers, sentencepiece
ContainerizationDocker (NVIDIA CUDA)
API ServerUvicorn (ASGI)

Quick Start

Start the backend with Dockerbash
cd Docker
docker build -t emotional-tts .
docker run -p 8000:8000 --gpus all emotional-tts
Test the APIbash
curl http://localhost:8000/health
curl http://localhost:8000/emotions

GPU Recommended

The TTS model runs significantly faster with CUDA GPU support. CPU inference is possible but slower.

Next Steps