Overview
Async provides high-quality text-to-speech synthesis with two service implementations:AsyncAITTSService (WebSocket-based) for real-time streaming with interruption support, and AsyncAIHttpTTSService (HTTP-based) for simpler synthesis. AsyncAITTSService is recommended for interactive applications requiring low latency.
AsyncAI TTS API Reference
Pipecat’s API methods for AsyncAI TTS integration
Example Implementation
Complete example with WebSocket streaming
Async Documentation
Official Async API documentation
Voice Models
Explore available voice models and features
Installation
To use Async services, install the required dependencies:Prerequisites
Async Account Setup
Before using Async TTS services, you need:- Async Account: Sign up at Async
- API Key: Generate an API key from your account dashboard
- Voice Selection: Choose from available voice models
Required Environment Variables
ASYNCAI_API_KEY: Your Async API key for authentication
Configuration
AsyncAITTSService
str
required
Async API key.
str
default:"None"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use
settings=AsyncAITTSService.Settings(voice=...) instead.str
default:"None"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use
settings=AsyncAITTSService.Settings(model=...) instead.str
default:"v1"
Async API version.
str
default:"wss://api.async.com/text_to_speech/websocket/ws"
WebSocket endpoint URL.
int
default:"None"
Output audio sample rate in Hz. When
None, uses the pipeline’s configured
sample rate.str
default:"pcm_s16le"
Audio encoding requested from Async. The service pushes the returned bytes as
16-bit mono PCM, so keep the default.
str
default:"raw"
Audio container format. The service doesn’t strip container headers, so keep
the default.
TextAggregationMode
default:"None"
Controls how incoming text is aggregated before synthesis.
SENTENCE (used
when None) buffers text until sentence boundaries, producing more natural
speech. TOKEN streams tokens directly for lower latency. Import from
pipecat.services.tts_service.bool
default:"None"
deprecated
Deprecated since 0.0.104, removed in 2.0.0. Use
text_aggregation_mode
instead.InputParams
default:"None"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use
settings=AsyncAITTSService.Settings(...) instead.AsyncAIHttpTTSService
The HTTP service waits for each request’s complete audio before pushing it, so the first audio arrives later than withAsyncAITTSService. It accepts similar parameters to the WebSocket service, with these differences:
aiohttp.ClientSession
required
An aiohttp session for HTTP requests. You must create and manage this
yourself.
str
default:"https://api.async.com"
HTTP API base URL (instead of WebSocket URL).
Settings
Runtime-configurable settings passed via thesettings constructor argument using AsyncAITTSService.Settings(...). These can be updated mid-conversation with TTSUpdateSettingsFrame. On AsyncAITTSService, a change reconnects the WebSocket, so audio not yet received for the current response is dropped. See Service Settings for details.
Usage
Basic Setup
With Language Customization
HTTP Service
Event Handlers
AsyncAITTSService supports the standard service connection events: