TTS (Text-to-Speech)
TTS is used in pipeline mode to synthesize the agent’s response audio. If you use an engine such asOpenAIRealtime or ElevenLabsConvAI, speech synthesis is handled internally by the engine.
Each TTS ships as both a namespaced class (from getpatter.tts import elevenlabs → elevenlabs.TTS()) and a flat alias (from getpatter import ElevenLabsTTS). They are equivalent — the flat aliases are convenient for short examples, the namespaced form avoids name collisions when mixing providers.
Quickstart
Supported providers
| Flat import | Namespaced import | Env var | Install extra |
|---|---|---|---|
ElevenLabsTTS | getpatter.tts.elevenlabs.TTS | ELEVENLABS_API_KEY | included |
OpenAITTS | getpatter.tts.openai.TTS | OPENAI_API_KEY | included |
CartesiaTTS | getpatter.tts.cartesia.TTS | CARTESIA_API_KEY | getpatter[cartesia] |
RimeTTS | getpatter.tts.rime.TTS | RIME_API_KEY | getpatter[rime] |
LMNTTTS | getpatter.tts.lmnt.TTS | LMNT_API_KEY | getpatter[lmnt] |
ElevenLabs
Streaming HTTP TTS via ElevenLabseleven_turbo_v2_5.
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | None | None | API key — reads from ELEVENLABS_API_KEY if omitted. |
voice_id | str | "21m00Tcm4TlvDq8ikWAM" | ElevenLabs voice ID (or name). |
model_id | str | "eleven_turbo_v2_5" | Model preset. |
output_format | str | "pcm_16000" | ElevenLabs output format. |
OpenAI
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | None | None | API key — reads from OPENAI_API_KEY if omitted. |
voice | str | "alloy" | One of "alloy", "echo", "fable", "onyx", "nova", "shimmer". |
model | str | "tts-1" | OpenAI TTS model ID. |
OpenAI TTS returns audio at 24 kHz — Patter automatically resamples to 16 kHz for telephony.
Cartesia
Raw PCM streaming via Cartesia’s sonic-2 bytes endpoint. See Cartesia setup.Rime
Arcana (high fidelity) and Mist (low latency) via Rime’s HTTP endpoint. See Rime setup.LMNT
Blizzard and Aurora via the LMNT HTTP API. See LMNT setup.Missing credentials
Each class raisesValueError at construction time if no API key is resolved:
What’s Next
STT
Speech-to-text providers.
LLM
Language model providers.

