Overview
SpeechmaticsTTSService provides production-grade, low-latency synthesis optimized for telephony and voice agents. By streaming 16kHz mono audio, it ensures bandwidth efficiency and prioritizes pronunciation accuracy for natural, uninterrupted conversations at scale.
Speechmatics TTS API Reference
Pipecat’s API methods for Speechmatics TTS integration
Example Implementation
Complete example with Speechmatics TTS
Speechmatics Documentation
Official Speechmatics TTS API documentation
Speechmatics Portal
Browse and test available voices
Installation
To use Speechmatics services, install the required dependencies:Prerequisites
Speechmatics Account Setup
Before using Speechmatics TTS services, you need:- Speechmatics Account: Sign up at Speechmatics Portal
- API Key: Generate an API key from your dashboard
- Voice Selection: Choose from available voices
Required Environment Variables
SPEECHMATICS_API_KEY: Your Speechmatics API key for authentication
Configuration
SpeechmaticsTTSService
Speechmatics API key for authentication.
Base URL for Speechmatics TTS API.
Voice model to use for synthesis.
An aiohttp session for HTTP requests.
Audio sample rate in Hz. Speechmatics TTS only supports 16kHz.
Runtime-configurable service settings. See InputParams below.
InputParams
| Parameter | Type | Default | Description |
|---|---|---|---|
max_retries | int | 5 | Maximum number of retries for TTS requests when receiving 503 responses. |
Usage
Basic Setup
With Custom Settings
Notes
- Fixed sample rate: Speechmatics TTS only supports 16kHz output. Using a different sample rate may cause issues.
- Automatic retry with backoff: The service automatically retries on 503 (service unavailable) responses using exponential backoff, up to
max_retriesattempts. - HTTP-based service: Speechmatics TTS uses HTTP streaming, so it does not have WebSocket connection events.
- Requires aiohttp session: You must create and manage an
aiohttp.ClientSessionyourself and pass it to the constructor.