Overview
XTTSService provides multilingual voice synthesis through a locally hosted Coqui XTTS-v2 streaming server, speaking with one of the server’s studio speakers.
XTTS API Reference
Pipecat’s API methods for XTTS integration
Example Implementation
Complete example with a studio speaker
XTTS Repository
Official XTTS streaming server repository
Installation
XTTS requires a running streaming server. Start the server using Docker:Prerequisites
XTTS Server Setup
Before usingXTTSService, you need:
- Docker Environment: Set up Docker with GPU support for optimal performance
- XTTS Server: Run the XTTS streaming server container
Required Configuration
- Server URL: Configure the XTTS server endpoint (default:
http://localhost:8000) - Voice Selection: Choose one of the server’s studio speakers
GPU acceleration is recommended for optimal performance. The server requires
CUDA support for best results.
Configuration
XTTSService
str
default:"None"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use
settings=XTTSService.Settings(voice=...) instead.str
required
Base URL of the XTTS streaming server (e.g.
http://localhost:8000).aiohttp.ClientSession
required
An aiohttp session for HTTP requests to the XTTS server.
Language
default:"Language.EN"
deprecated
Deprecated since 0.0.106, removed in 2.0.0. Use
settings=XTTSService.Settings(language=...) instead.int
default:"None"
Output audio sample rate in Hz. When
None, uses the pipeline’s configured
sample rate. Audio is automatically resampled from XTTS’s native 24kHz output.Settings
Runtime-configurable settings passed via thesettings constructor argument using XTTSService.Settings(...). These can be updated mid-conversation with TTSUpdateSettingsFrame. See Service Settings for details.
Usage
Basic Setup
With Language Configuration
Notes
- Local server required: XTTS requires a locally running streaming server (via Docker). The service connects to this server over HTTP.
- Studio speakers: On startup, the service fetches available “studio speakers” from the server’s
/studio_speakersendpoint. Thevoicesetting must match one of these speakers; otherwise each request pushes anErrorFrame. - Audio resampling: XTTS natively outputs audio at 24kHz. The service automatically resamples to match the pipeline’s configured sample rate.
- GPU recommended: The XTTS server performs best with CUDA-enabled GPU acceleration. CPU inference is significantly slower.
- No API key required: XTTS runs locally, so no external API credentials are needed.