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
str
required
Resemble AI API key for authentication.
str
default:"None"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use
settings=ResembleAITTSService.Settings(voice=...) instead.str
default:"wss://websocket.cluster.resemble.ai/stream"
WebSocket URL for Resemble AI TTS API.
str
default:"PCM_16"
PCM bit depth. Options:
PCM_32, PCM_24, PCM_16, or MULAW. The service
pushes the audio as 16-bit PCM, so only PCM_16 plays correctly.str
default:"wav"
Audio output format (
wav or mp3). The service pushes the audio as raw PCM,
so only wav plays correctly.int
default:"22050"
Audio sample rate in Hz. Options: 8000, 16000, 22050, 32000, or 44100.
Settings
Runtime-configurable settings passed via thesettings constructor argument using ResembleAITTSService.Settings(...). These can be updated mid-conversation with TTSUpdateSettingsFrame. See Service Settings for details.
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 holds back the first 44,100 bytes of each response’s audio before pushing any, which delays the start of speech by about 1 second at the default 22050 Hz (about half a second at 44100 Hz).
- 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.