Skip to content

API Reference parrot.voice.tts.polly_backend

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.voice.tts.polly_backend

View source

Amazon Polly text-to-speech backend.

Alias AbstractTTSBackend

Re-exported from parrot.voice.tts.backend.AbstractTTSBackend.

Class AmazonPollyTTSBackend

TTS backend over Amazon Polly using aioboto3.

Parameter Type Default Description
voice Optional[str] None Default Amazon Polly voice identifier.
engine str 'long-form' Polly engine to use for synthesis.
region Optional[str] None AWS region, falling back to AWS_POLLY_REGION.
**kwargs Any {} Additional aioboto3 session keyword arguments.

Method AmazonPollyTTSBackend.synthesize

Synthesize text sequentially through Amazon Polly.

synthesize(text: str, *, voice: Optional[str] = None, mime_format: str = 'audio/mpeg', language: Optional[str] = None) -> SynthesisResult

Parameter Type Default Description
text str Text to synthesize.
voice Optional[str] None Optional Polly voice override.
mime_format str 'audio/mpeg' Requested supported output MIME type.
language Optional[str] None Optional BCP-47 language code for Polly.

Returns: SynthesisResult — Concatenated audio output from every Polly chunk.

Raises:

  • ValueError — If text is empty or the MIME type is unsupported.
  • ImportError — If the optional Polly dependency is not installed.
  • RuntimeError — If Polly rejects or fails a synthesis request.

Method AmazonPollyTTSBackend.close

Release the lazily created aioboto3 session reference.

close() -> None

Alias SynthesisResult

Re-exported from parrot.voice.tts.models.SynthesisResult.

Function split_text_for_polly

Split text into sentence-oriented chunks accepted by Amazon Polly.

split_text_for_polly(text: str, max_chars: int = _MAX_CHARS) -> list[str]

Parameter Type Default Description
text str The source text to split.
max_chars int _MAX_CHARS Maximum number of characters in each chunk.

Returns: list[str] — Chunks in their original order, each no longer than max_chars.

Raises:

  • ValueError — If max_chars is not positive.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally