Overview
ResembleAITTSService provides high-quality text-to-speech synthesis using Resemble AI’s streaming WebSocket API with word-level timestamps and audio context management for handling multiple simultaneous synthesis requests with proper interruption support.
Resemble AI TTS API Reference
Pipecat’s API methods for Resemble AI TTS integration
Example Implementation
Complete example with interruption handling
Resemble AI Documentation
Official Resemble AI API documentation
Sign up
Sign up for a Resemble AI account
Installation
To use Resemble AI services, install the required dependencies:Prerequisites
Resemble AI Account Setup
Before using Resemble AI TTS services, you need:- Resemble AI Account: Sign up at Resemble AI
- API Key: Generate an API key from your account settings
- Voice Selection: Choose or create voice UUIDs from your voice library
Required Environment Variables
RESEMBLE_API_KEY: Your Resemble AI API key for authentication
Configuration
ResembleAITTSService
Resemble AI API key for authentication.
Voice UUID to use for synthesis.
WebSocket URL for Resemble AI TTS API.
PCM bit depth. Options:
PCM_32, PCM_24, PCM_16, or MULAW.Audio output format (
wav or mp3).Audio sample rate in Hz. Options: 8000, 16000, 22050, 32000, or 44100.
Usage
Basic Setup
With Custom Settings
Notes
- Word-level timestamps: Resemble AI provides word-level timing information, enabling synchronized text highlighting and precise interruption handling.
- Jitter buffering: The service buffers approximately 1 second of audio before starting playback to absorb network latency gaps (Resemble AI sends audio in bursts with 300-450ms gaps).
- Audio context management: Supports multiple simultaneous synthesis requests with proper context tracking and interruption handling.
- Default sample rate: Defaults to 22050 Hz. Supported rates are 8000, 16000, 22050, 32000, and 44100 Hz.
Event Handlers
Resemble AI TTS supports the standard service connection events:| Event | Description |
|---|---|
on_connected | Connected to Resemble AI WebSocket |
on_disconnected | Disconnected from Resemble AI WebSocket |
on_connection_error | WebSocket connection error occurred |