Skip to main content

Amazon Polly bidirectional streaming over HTTP/2 with SigV4: implements StartSpeechSynthesisStream, the Polly API that boto3 does not yet expose (only the AWS Java SDK has it).

  • Async generator interface: async for chunk in client.start_speech_synthesis_stream(...) yields audio bytes as they arrive from Polly, with no need to wait for the full audio to be generated server-side.

  • Real bidirectional: events sent to Polly and audio events received are framed in AWS event-stream over HTTP/2, with rolling chunk-signatures (the same scheme amazon-transcribe-streaming-sdk uses for Transcribe streaming).

  • Typed: PEP 561 py.typed marker; full pyright-strict surface for downstream consumers.

Full documentation on readthedocs.

Installation

pip install amazon-polly-streaming

Quick start

import asyncio
from amazon_polly_streaming import PollyStreamingClient

async def main() -> None:
    client = PollyStreamingClient(region="eu-central-1")
    audio = b""
    async for chunk in client.start_speech_synthesis_stream(
        text="hello world, how are you today",
        voice_id="Matthew",
        engine="generative",
        language_code="en-US",
        output_format="mp3",
        sample_rate="24000",
    ):
        audio += chunk
    with open("hello.mp3", "wb") as fh:
        fh.write(audio)

asyncio.run(main())

The voice_id must be a generative voice supporting bidirectional streaming. See the Amazon Polly Generative voices page for the current list and supported regions.

Requirements

  • Python 3.13+

  • AWS credentials in the default chain (env vars, profile, or IAM role) with polly:StartSpeechSynthesisStream permission

  • A region supporting Polly bidirectional streaming (us-east-1, us-west-2, eu-central-1, eu-west-2, ap-southeast-1, ca-central-1 as of 2026-05)

License

This package is released under the Apache License 2.0. See LICENSE and NOTICE for details.

Metadata

Release files for amazon-polly-streaming 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for amazon-polly-streaming 1.1.0
File Size Uploaded Provenance Actions
amazon_polly_streaming-1.1.0.tar.gz 34.7 kB Without provenance Details for amazon_polly_streaming-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for amazon-polly-streaming 1.1.0
File Interpreter ABI Platform Actions
amazon_polly_streaming-1.1.0-py3-none-any.whl Python 3 none any Details for amazon_polly_streaming-1.1.0-py3-none-any.whl

Total release size: 61.6 kB

Release files / amazon_polly_streaming-1.1.0.tar.gz

Download URL amazon_polly_streaming-1.1.0.tar.gz
Size 34.7 kB
Tags Source
SHA-256 checksum
How to use checksums
48640089be3090304eb114232d09c10e3eff106372c54a3e240357c288dadb2a
BLAKE2b-256 checksum
How to use checksums
7bcdf7678d91a19fa64473bd92533b8f632d58a62d689df7ef82647ab9afda66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release files / amazon_polly_streaming-1.1.0-py3-none-any.whl

Download URL amazon_polly_streaming-1.1.0-py3-none-any.whl
Size 26.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6fd41b0e2920398ed48c23bbf0307d781447aa90c88fae71e8c49f27b5c963ed
BLAKE2b-256 checksum
How to use checksums
c71fa2479765b9062256f4053e32ad5418a345e214c9ab9e82c803ae45ac303d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Security for amazon-polly-streaming 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page