Skip to main content
XTTSService is deprecated as of v1.7.0 and will be removed in v2.0.0. The Coqui XTTS streaming server it connects to has been unmaintained since February 2024 and pins a commit of the discontinued coqui-ai/TTS library. The XTTS-v2 model is licensed for non-commercial use only.Alternatives:

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 using XTTSService, you need:
  1. Docker Environment: Set up Docker with GPU support for optimal performance
  2. 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.
XTTSService.Settings
default:"None"
Runtime-configurable settings. See Settings below.
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 the settings 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_speakers endpoint. The voice setting must match one of these speakers; otherwise each request pushes an ErrorFrame.
  • 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.