Overview
AWSPollyTTSService provides high-quality text-to-speech synthesis through Amazon Polly with support for standard, neural, and generative engines. The service offers extensive language support, SSML features, and voice customization options including prosody controls for pitch, rate, and volume.
AWS Polly API Reference
Pipecat’s API methods for AWS Polly integration
Example Implementation
Complete example with generative engine
AWS Polly Documentation
Official AWS Polly documentation and features
Voice Samples
Browse available voices and languages
Installation
To use AWS Polly services, install the required dependencies:Prerequisites
AWS Account Setup
Before using AWS Polly TTS services, you need:- AWS Account: Sign up at AWS Console
- IAM User: Create an IAM user with Polly permissions
- Access Keys: Generate access key ID and secret access key
- Voice Selection: Choose from available voices in the voice list
Required Environment Variables
AWS_ACCESS_KEY_ID: Your AWS access key IDAWS_SECRET_ACCESS_KEY: Your AWS secret access keyAWS_SESSION_TOKEN: Session token (if using temporary credentials)AWS_REGION: AWS region (defaults to “us-east-1”)
Configuration
AWSPollyTTSService
AWS secret access key. If
None, uses the AWS_SECRET_ACCESS_KEY environment variable.AWS access key ID. If
None, uses the AWS_ACCESS_KEY_ID environment variable.AWS session token for temporary credentials.
AWS region for Polly service. Defaults to
us-east-1 if not set via environment variable.Voice ID to use for synthesis.
Output audio sample rate in Hz. When
None, uses the pipeline’s configured sample rate. AWS Polly internally synthesizes at 16kHz and resamples to the target rate.Runtime-configurable voice and generation settings. See InputParams below.
InputParams
Voice and generation settings that can be set at initialization via theparams constructor argument, or changed at runtime via UpdateSettingsFrame.
| Parameter | Type | Default | Description |
|---|---|---|---|
engine | str | None | TTS engine to use ("standard", "neural", "generative", etc.). |
language | Language | Language.EN | Language for synthesis. |
pitch | str | None | Voice pitch adjustment (for standard engine only, e.g. "+10%"). |
rate | str | None | Speech rate adjustment (e.g. "slow", "fast", "120%"). |
volume | str | None | Voice volume adjustment (e.g. "loud", "soft", "+6dB"). |
lexicon_names | list[str] | None | List of pronunciation lexicon names to apply. |
Usage
Basic Setup
With Voice Customization
Notes
- Engine selection: AWS Polly supports
"standard","neural", and"generative"engines. Not all voices support all engines. Check the AWS voice list for compatibility. - Pitch control: The
pitchparameter only works with the"standard"engine. Neural and generative engines ignore it. - Audio resampling: Polly synthesizes PCM at 16kHz internally. The service automatically resamples to match your pipeline’s sample rate.