Polly Voice Deployer
An AWS CloudOps agent skill that deploys Amazon Polly text-to-speech
configurations with correct engine, voice, format, and pricing
defaults. The skill walks the operator through engine selection
(standard vs neural vs long-form vs generative), voice selection by
language and locale, SSML processing capabilities and per-engine
constraints, lexicon-based custom pronunciation, speech marks for
lip-sync alignment, the synthesize-speech real-time API vs the
start-speech-synthesis-task asynchronous API, output format and
sample rate selection, CloudWatch monitoring, and pricing-per-
character budgeting, captures all synthesis parameters, explains why
each default matters, and emits a READY_TO_DEPLOY checklist with
copy-pasteable verification commands.
Activation keywords
synthesize speech, polly neural voice, polly SSML, polly lexicon,
speech marks, start speech synthesis task, polly engine selection,
polly pricing per character.
STRICT output contract
When this skill is invoked with a Polly text-to-speech deployment
request (synthesize speech, select an engine, configure SSML,
create a lexicon, generate speech marks, run a batch synthesis to
S3, or a partial configuration), the agent MUST respond with the
READY_TO_DEPLOY checklist defined in the "Output format" section
using the literal all-caps labels POLLY_VOICE:, VERDICT:,
CHECKLIST:, and VERIFICATION_COMMANDS:. Do NOT preface the
checklist with prose, headings, or disclaimers — emit the block as
the first lines of the response. This contract is what assertion-
based evals and downstream deployment pipelines rely on; deviating
from the literal labels breaks automation silently.
If any prerequisite is missing, the verdict is PREREQUISITES_MISSING
with a specific gap citation in the checklist (marked [✗]), and
READY_TO_DEPLOY MUST NOT also appear.
Quick navigation
| Section |
When to read |
| Prerequisites |
Always — verify before deployment |
| Step 1 — Engine selection (standard vs neural vs long-form vs generative) |
Quality and cost decisions |
| Step 2 — Voice selection by language |
Voice and locale matching |
| Step 3 — SSML processing (phoneme, emphasis, break, prosody) |
Markup control |
| Step 4 — Lexicon management (custom pronunciation) |
Pronunciation overrides |
| Step 5 — Speech marks (lip-sync alignment) |
Visual media sync |
| Step 6 — synthesize-speech API (real-time) |
Short-text synthesis |
| Step 7 — start-speech-synthesis-task (async to S3) |
Long-text batch synthesis |
| Step 8 — Output format and sample rate |
Audio encoding |
| Step 9 — CloudWatch metrics |
Monitoring |
| Step 10 — Pricing per character |
Cost budgeting |
| Step 11 — Recent features |
Latest |
| NEVER do these things |
Review before signing off |
| Output format |
The literal checklist template |
| references/engine-and-voice-selection.md |
Engine + voice detail |
| references/ssml-and-lexicons.md |
SSML + lexicon detail |
Mindset
One-line takeaway: Amazon Polly converts text to speech using
four engine types. Neural voices are higher quality but cost roughly
4x standard per character. SSML break and emphasis tags only work
with the standard engine. Lexicons map custom words to phonetic
equivalents. Speech marks are generated as a separate request and
returned as JSON line-delimited timestamps aligned to the audio.
Three misconceptions dominate Polly misdeployment at provisioning
time:
Moved to references/advanced-patterns.md.
Three Polly misconceptions: neural SSML support, text-length limits, speech-mark delivery.
Configuration dependency graph (novel heuristic)
Moved to references/advanced-patterns.md.
How to sequence deployment using the dependency graph.
| Configuration |
Hard dependencies (API error without) |
Silent failure / immutability |
Enables downstream |
| Engine selection |
— (any engine can be chosen) |
SSML <break> and <emphasis> silently ignored by neural/long-form/generative |
voice list (per-engine voices differ) |
| Voice ID |
engine must support the voice |
requesting a standard-only voice with neural returns InvalidParameterValue |
language and locale |
| Output format |
— |
pcm requires 8000/16000 sample rate; mp3/ogg support 22050/24000 |
audio encoding |
| Sample rate |
must be valid for output format |
requesting 24000 with pcm silently coerces or errors |
audio quality |
| Lexicon upload |
lexicon Name must be unique in account+region |
lexicon referenced in synthesis but not uploaded → synthesis fails with LexiconNotFound |
custom pronunciation |
| SSML input |
must be well-formed XML |
<break>/<emphasis> silently ignored by neural engine |
prosody control |
| Speech marks |
separate synthesize-speech call with OutputFormat=json |
requesting speech marks with OutputFormat=mp3 returns no marks |
lip-sync / captioning |
| Async task (S3) |
S3 bucket exists and Polly has WriteS3 access |
task fails if S3 permissions missing; check task status |
batch synthesis |
Moved to references/advanced-patterns.md.
Baseline-miss rows and gotchas: engine/voice subsets, engine SSML support, format-rate coupling, separate marks call, per-region lexicons.
Expert heuristic: engine selection decision tree
Moved to references/advanced-patterns.md.
Engine selection balancing SSML needs, voice availability, and cost.
Expert heuristic: real-time vs async synthesis
Moved to references/advanced-patterns.md.
Real-time vs async path by text length and latency needs; marks are a separate request.
Expert heuristic: pricing per character across engines
Moved to references/advanced-patterns.md.
Per-character pricing by engine with cost estimation and billing rules.
Prerequisites (verify before deployment)
Before emitting deployment commands, verify these prerequisites. If
any are missing, the verdict is PREREQUISITES_MISSING.
| Prerequisite |
Why it matters |
How to verify |
| Input text available |
Polly synthesizes from text input |
Confirm text source and encoding (UTF-8) |
| Engine selected |
Determines voice availability, SSML support, and cost |
Decide: standard, neural, long-form, generative |
| Voice ID identified |
Must be valid for the selected engine |
aws polly describe-voices --engine <engine> |
| Language/locale matched |
Voice must match the input text language |
aws polly describe-voices --language-code en-US |
| Output format chosen |
mp3, ogg_vorbis, pcm, or json (speech marks) |
Decide based on downstream player |
| Sample rate valid for format |
pcm = 8000/16000; mp3/ogg = 22050/24000 |
Match format to rate |
| SSML tags engine-compatible |
<break>/<emphasis> only work with standard engine |
Verify engine if SSML uses these tags |
| S3 output bucket (async task) |
Batch synthesis writes to S3 |
aws s3 ls s3://<bucket> |
| IAM permissions |
polly:SynthesizeSpeech or polly:StartSpeechSynthesisTask |
Verify IAM policy |
| Lexicon uploaded (if referenced) |
Lexicon must exist before synthesis calls it |
aws polly list-lexicons |
If any prerequisite is missing, output VERDICT: PREREQUISITES_MISSING
and cite the specific gap.
Step 1 — Engine selection (standard vs neural vs long-form vs generative)
Amazon Polly offers four TTS engines. Each has different quality,
voice availability, SSML support, and pricing.
| Engine |
Quality |
Voice availability |
SSML support |
Cost (per 1M chars) |
| standard |
Good |
ALL voices (all languages) |
Full SSML (<break>, <emphasis>, <prosody>, <phoneme>, <say-as>) |
$4.00 |
| neural |
High |
Subset of voices |
Partial (<prosody>, <phonome>, <say-as>; NOT <break>, <emphasis>) |
$16.00 |
| long-form |
Highest (narrative) |
Small subset (long-form-optimized voices) |
Partial (<prosody>; NOT <break>, <emphasis>) |
$100.00 |
| generative |
Highest (conversational) |
Small subset (generative voices) |
Partial (<prosody>; NOT <break>, <emphasis>) |
$120.00 |
Critical SSML constraint: the <break> and <emphasis> tags
are ONLY processed by the standard engine. Neural, long-form, and
generative engines silently ignore these tags. If the use case
requires precise pause control, the standard engine is mandatory.
Moved to references/diagnostic-commands.md.
describe-voices listings per engine for voice discovery.
Step 2 — Voice selection by language
Each Polly voice is identified by a Voice ID (e.g., Joanna,
Matthew, Lupe). Voices are language-specific. Not all voices
are available for all engines.
| Language code |
Example voices |
Neural available |
| en-US |
Joanna, Matthew, Stephen, Kevin, Danielle, Gregory |
Yes (Joanna, Matthew, Stephen, Kevin, Danielle, Gregory) |
| en-GB |
Amy, Emma, Brian |
Yes (Amy, Emma, Brian) |
| en-AU |
Nicole, Olivia |
Yes (Nicole, Olivia) |
| es-US |
Lupe, Miguel, Penelope, Lucia, Diego |
Partial (Lupe, Lucia, Diego) |
| fr-FR |
Lea, Remi |
Yes (Lea, Remi) |
| de-DE |
Vicki, Daniel |
Yes (Vicki, Daniel) |
| ja-JP |
Kazuha, Tomoko |
Partial |
| ko-KR |
Seoyeon |
Yes |
| zh-CN |
Zhiyu |
Yes |
Moved to references/diagnostic-commands.md.
describe-voices by language-code and per-voice neural support check.
Select a voice that:
- Matches the input text language (language-code).
- Is available on the chosen engine.
- Has the desired gender and style.
Step 3 — SSML processing (phoneme, emphasis, break, prosody)
SSML (Speech Synthesis Markup Language) provides fine-grained control
over pronunciation, pacing, emphasis, and prosody. Polly supports a
subset of SSML tags.
| SSML tag |
Purpose |
Engine support |
<break> |
Insert a pause (e.g., <break time="500ms"/>) |
Standard ONLY |
<emphasis> |
Emphasize a word (e.g., <emphasis level="strong">important</emphasis>) |
Standard ONLY |
<prosody> |
Control rate, pitch, volume (e.g., <prosody rate="slow">text</prosody>) |
ALL engines |
<phoneme> |
Phonetic pronunciation via IPA (e.g., <phoneme alphabet="ipa" ph="ˈtɒmɑtəʊ">tomato</phoneme>) |
Standard + Neural |
<say-as> |
Interpret text type (e.g., <say-as interpret-as="date" format="mdy">01/15/2024</say-as>) |
ALL engines |
<speak> |
Root SSML element (wraps all SSML) |
ALL engines |
<sub> |
Substitute pronunciation (e.g., <sub alias=" Avenue">Ave</sub>) |
Standard + Neural |
<w> |
Part-of-speech override |
Standard + Neural |
<amazon:effect> |
Whisper, dynamical range compression |
Standard + Neural |
Moved to references/ssml-and-lexicons.md.
Full-tag SSML for standard engine; prosody/phoneme-only SSML for neural.
Critical: if the SSML uses <break> or <emphasis> and the
engine is neural/long-form/generative, the tags are silently ignored.
The synthesis succeeds but the pauses and emphasis do not appear in
the output audio. This is the #1 Polly deployment surprise.
Step 4 — Lexicon management (custom pronunciation)
Lexicons (PLS — Pronunciation Lexicon Specification) allow custom
pronunciation mappings. A lexicon maps a word to its phonetic
equivalent so that Polly pronounces it correctly every time.
Lexicon use cases:
- Company names, product names, and acronyms.
- Domain-specific terminology (medical, legal, technical).
- Regional pronunciation variants.
Moved to references/ssml-and-lexicons.md.
PLS lexicon file, put-lexicon upload, lexicon use in synthesis, list/get verification, constraints.
Step 5 — Speech marks (lip-sync alignment)
Speech marks are timestamp-aligned markers that map text positions
to audio positions. They are essential for lip-sync animation,
captioning, and highlighting text as audio plays.
Speech mark types:
| Type |
Description |
Use case |
viseme |
Visual mouth-shape codes for animation |
3D avatar lip-sync |
word |
Word-level start/end timestamps |
Text highlighting, caption sync |
sentence |
Sentence boundaries |
Caption segmentation |
ssml |
SSML tag timestamps |
SSML mark navigation |
Moved to references/worked-examples.md.
Speech-mark synthesis command, line-delimited JSON output, and field semantics.
Critical: speech marks are generated as a SEPARATE call from the
audio. The audio synthesis (OutputFormat=mp3) and the marks
synthesis (OutputFormat=json) must use the SAME engine, voice, text,
sample rate, and lexicons for the timestamps to align correctly.
Step 6 — synthesize-speech API (real-time)
The synthesize-speech API is the real-time synthesis endpoint. It
returns the audio stream directly in the HTTP response. Use for
short text (under ~3000 characters) where low latency is required.
Moved to references/worked-examples.md.
Plain-text, SSML, and lexicon real-time synthesis invocations.
API constraints:
- Maximum input text length: ~3000 characters (varies by configuration).
- Returns audio as a binary stream in the response body.
- Synchronous — the caller waits for synthesis to complete.
- Latency: typically 200-600ms for neural, 100-300ms for standard.
Step 7 — start-speech-synthesis-task (async to S3)
The start-speech-synthesis-task API is the asynchronous synthesis
endpoint for long text. It writes the output audio file to a
specified S3 bucket. Use for batch processing, long-form content
(articles, books), and pre-generation of audio assets.
Moved to references/worked-examples.md.
start-speech-synthesis-task with S3 output, status check, and task listing.
Task lifecycle:
scheduled → queued → inProgress → completed | failed
- On completion, the audio file is available at the S3 URI:
s3://<bucket>/<key-prefix>/<task-id>.mp3
S3 IAM permissions required:
Polly needs s3:PutObject on the output bucket. The service-linked
role PollySynthesisTaskServiceRole is typically auto-managed.
Moved to references/diagnostic-commands.md.
S3 listing check for the completed async synthesis output.
Step 8 — Output format and sample rate
Output format and sample rate are coupled. Not all combinations are
valid.
| Output format |
Valid sample rates |
Use case |
| mp3 |
22050, 24000 |
General-purpose audio playback |
| ogg_vorbis |
22050, 24000 |
Web audio, streaming |
| pcm |
8000, 16000 |
Telephony, raw audio processing |
| json |
N/A (speech marks only) |
Speech marks / lip-sync |
Moved to references/worked-examples.md.
Telephony PCM 8000 Hz and high-quality MP3 24000 Hz synthesis.
Mismatching format and sample rate (e.g., PCM at 24000 Hz) will
produce an error or silently coerce the output.
Step 9 — CloudWatch metrics
Polly publishes metrics to CloudWatch for monitoring synthesis
volume, errors, and latency.
| Metric |
Description |
RequestCharacters |
Total characters processed (for billing estimation) |
ResponseLatency |
Average synthesis latency |
2XXCount / 4XXCount / 5XXCount |
HTTP response code counts |
ThrottledCount |
Throttled request count (if exceeding limits) |
Moved to references/diagnostic-commands.md.
get-metric-statistics for RequestCharacters and a character-budget billing alarm.
Step 10 — Pricing per character
Polly pricing is per-character of input text. SSML tags are NOT
counted — only the text content between tags.
| Engine |
Price per 1M characters (us-east-1) |
Notes |
| standard |
$4.00 |
All voices, full SSML |
| neural |
$16.00 |
4x standard; subset of voices |
| long-form |
$100.00 |
Audiobook-quality narration |
| generative |
$120.00 |
Most expressive conversational voices |
Moved to references/diagnostic-commands.md.
Character-count and monthly cost estimation one-liners.
Free tier: 5 million characters per month for standard voices,
1 million characters per month for neural voices (for the first 12
months).
Step 11 — Recent features
Moved to references/advanced-patterns.md.
Recent AWS features (2023-2026): generative engine, long-form enhancements, neural expansion, enhanced metrics, SSE-KMS, viseme improvements.
NEVER do these things
NEVER use <break> or <emphasis> SSML tags with neural,
long-form, or generative engines. These tags are ONLY processed
by the standard engine. Neural and others silently ignore them.
If the use case requires pause control, use standard engine or
<prosody rate> for timing adjustment.
NEVER assume speech marks are returned with the audio. Speech
marks are a SEPARATE synthesize-speech call with
OutputFormat=json and SpeechMarkTypes specified. The audio
and marks are two different requests.
NEVER use synthesize-speech for long text (>3000 chars).
The real-time API has a payload limit. For longer text, use
start-speech-synthesis-task which writes to S3 and handles
arbitrarily long input.
NEVER request a sample rate incompatible with the output
format. PCM supports only 8000 and 16000 Hz. MP3 and OGG
support 22050 and 24000 Hz. Mismatching produces errors or
silent coercion.
NEVER assume all voices are available on all engines. Neural,
long-form, and generative each support a SUBSET of the standard
voice catalog. Always verify with describe-voices --engine.
NEVER assume lexicons are global. Lexicons are per-region.
A lexicon uploaded in us-east-1 is NOT available in eu-west-1.
Upload to each region where needed.
NEVER forget to verify the S3 output for async tasks. The
task may fail due to IAM permissions or bucket policy. Always
check get-speech-synthesis-task status and verify the S3
object exists.
NEVER estimate cost without checking the engine rate. Neural
is 4x standard, long-form is 25x standard, generative is 30x
standard. High-volume workloads must budget by engine.
NEVER use PCM output for web playback. PCM is raw, unheadered
audio. Use MP3 or OGG for web and mobile applications. PCM is
for telephony and audio processing pipelines.
NEVER reference a lexicon before uploading it. The synthesis
call will fail with LexiconNotFound. Always put-lexicon
before referencing it in synthesize-speech.
Output format
POLLY_VOICE: <voice-id> (<engine> engine, <language-code>)
VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING
CHECKLIST:
[✓|✗] Engine: standard | neural | long-form | generative
[✓|✗] Voice: <voice-id> (<language-code>, <gender>)
[✓|✗] Voice available on engine: PASS | FAIL (voice not supported)
[✓|✗] SSML compatibility: <tags used> — PASS (all tags supported) | FAIL (<break>/<emphasis> not supported on neural)
[✓|✗] Output format: mp3 | ogg_vorbis | pcm | json
[✓|✗] Sample rate: <rate> Hz — PASS (valid for format) | FAIL (invalid for format)
[✓|✗] Lexicon: <name> — uploaded | not referenced
[✓|✗] Synthesis mode: real-time (synthesize-speech) | async (start-speech-synthesis-task → s3://<bucket>/<key>)
[✓|✗] Speech marks: <types> (separate request) | not required
[✓|✗] Estimated cost: $<amount> (<char-count> chars × $<rate>/1M)
[✓|✗] Tags: <key=value list>
VERIFICATION_COMMANDS:
aws polly describe-voices --engine <engine> --query 'Voices[?Id==`<voice-id>`]'
aws polly list-lexicons --query 'Lexicons[?Name==`<lexicon>`]'
aws polly get-speech-synthesis-task --task-id <task-id>
Worked example — neural voice real-time synthesis
POLLY_VOICE: Joanna (neural engine, en-US)
VERDICT: READY_TO_DEPLOY
CHECKLIST:
[✓] Engine: neural
[✓] Voice: Joanna (en-US, Female)
[✓] Voice available on engine: PASS (Joanna supports neural)
[✓] SSML compatibility: plain text (no SSML) — PASS
[✓] Output format: mp3
[✓] Sample rate: 24000 Hz — PASS (valid for mp3)
[✓] Lexicon: company-terms — uploaded
[✓] Synthesis mode: real-time (synthesize-speech)
[✓] Speech marks: not required
[✓] Estimated cost: $0.00 (52 chars × $16/1M = $0.000832)
[✓] Tags: Environment=production, UseCase=greeting
VERIFICATION_COMMANDS:
aws polly describe-voices --engine neural --query 'Voices[?Id==`Joanna`]'
aws polly list-lexicons --query 'Lexicons[?Name==`company-terms`]'
Error handling
Moved to references/error-handling.md.
Symptom-by-symptom fixes: missing pauses, S3 access denied, voice/lexicon not found, empty marks, garbled PCM.
References (load on demand)
- advanced-patterns — expert-heuristic deep dives, misconceptions, dependency-graph notes, recent AWS features (2023-2026)
- worked-examples — filled-in synthesis examples (speech marks, real-time, async, output formats)
- diagnostic-commands — voice discovery, task verification, CloudWatch, and pricing commands
- error-handling — symptom-by-symptom troubleshooting
- engine-and-voice-selection — engine and voice selection detail (existing)
- ssml-and-lexicons — SSML and lexicon detail plus examples (existing)
Domain
AWS CloudOps / Amazon Polly Text-to-Speech Configuration & Voice
Synthesis Deployment.
AWS documentation
1---2name: polly-voice-deployer3description: 'Deploys Amazon Polly text-to-speech configurations with production defaults: engine selection (standard vs neural vs long-form vs generative), voice selection by language, SSML processing (phoneme, emphasis, break, prosody, say-as), lexicon management (custom pronunciation via PLS lexicons), speech marks generation for lip-sync and visual media sync, synthesize-speech API for real-time synthesis, start-speech-synthesis-task for asynchronous batch synthesis to S3, output formats (mp3, ogg_vorbis, pcm, json), sample rates (8000/16000/22050/24000), CloudWatch metrics monitoring, and pricing-per-character budgeting. Emits a READY_TO_DEPLOY checklist with verification commands. Use when configuring Polly TTS, synthesizing speech from text, deploying neural TTS voices, creating custom pronunciation lexicons, generating speech marks for lip-sync. Triggers: synthesize speech, polly neural voice, polly ssml, polly lexicon, speech marks, start speech synthesis task, polly engine selection, polly pricing per character.'4license: Apache-2.05compatibility: 'Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). For live deployment: AWS CLI v2 with polly access and s3 PutObject on the output bucket. Works with Terraform aws_polly_lexicon resources and CloudFormation custom resources for Polly configurations.'6metadata:7 source: https://skillmd.com/skills/jhkchan/polly-voice-deployer8 domain: aws-cloudops9 complexity: high10 requires_llm: 'true'11 phase: '1'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: AI/ML15 task_type: deploy16 skill_class: capability17 lifecycle_status: active18 verdict_shape: READY_TO_DEPLOY | PREREQUISITES_MISSING19 version: 0.1.020 author: Jacky Chan — AWS Community Builder21 tags: aws, polly, tts, cloudops, deploy, ai-ml, provisioning, neural-voice, ssml, lexicon, speech-marks22 dependencies: aws-orchestrator23 keywords: aws, polly, text to speech, tts, neural voice, cloudops, deploy, provisioning, ssml, lexicon, speech marks, synthesize speech, lip sync, pricing per character24 when_to_use: Invoke when the user wants to configure Amazon Polly for text-to-speech synthesis, select between standard/neural/long-form/ generative engines, use SSML tags for prosody control, create custom pronunciation lexicons, generate speech marks for lip-sync or captioning, run real-time synthesis via synthesize-speech, or batch-synthesize long text to S3 via start-speech-synthesis-task. Do NOT invoke for Amazon Transcribe (speech-to-text), Amazon Lex (conversational bots), or AWS Lambda function deployment.25---2627# Polly Voice Deployer2829An AWS CloudOps agent skill that deploys Amazon Polly text-to-speech30configurations with correct engine, voice, format, and pricing31defaults. The skill walks the operator through engine selection32(standard vs neural vs long-form vs generative), voice selection by33language and locale, SSML processing capabilities and per-engine34constraints, lexicon-based custom pronunciation, speech marks for35lip-sync alignment, the synthesize-speech real-time API vs the36start-speech-synthesis-task asynchronous API, output format and37sample rate selection, CloudWatch monitoring, and pricing-per-38character budgeting, captures all synthesis parameters, explains why39each default matters, and emits a READY_TO_DEPLOY checklist with40copy-pasteable verification commands.4142## Activation keywords4344synthesize speech, polly neural voice, polly SSML, polly lexicon,45speech marks, start speech synthesis task, polly engine selection,46polly pricing per character.4748## STRICT output contract4950When this skill is invoked with a Polly text-to-speech deployment51request (synthesize speech, select an engine, configure SSML,52create a lexicon, generate speech marks, run a batch synthesis to53S3, or a partial configuration), the agent MUST respond with the54READY_TO_DEPLOY checklist defined in the "Output format" section55using the literal all-caps labels `POLLY_VOICE:`, `VERDICT:`,56`CHECKLIST:`, and `VERIFICATION_COMMANDS:`. Do NOT preface the57checklist with prose, headings, or disclaimers — emit the block as58the first lines of the response. This contract is what assertion-59based evals and downstream deployment pipelines rely on; deviating60from the literal labels breaks automation silently.6162If any prerequisite is missing, the verdict is `PREREQUISITES_MISSING`63with a specific gap citation in the checklist (marked `[✗]`), and64`READY_TO_DEPLOY` MUST NOT also appear.6566## Quick navigation6768| Section | When to read |69|---|---|70| Prerequisites | Always — verify before deployment |71| Step 1 — Engine selection (standard vs neural vs long-form vs generative) | Quality and cost decisions |72| Step 2 — Voice selection by language | Voice and locale matching |73| Step 3 — SSML processing (phoneme, emphasis, break, prosody) | Markup control |74| Step 4 — Lexicon management (custom pronunciation) | Pronunciation overrides |75| Step 5 — Speech marks (lip-sync alignment) | Visual media sync |76| Step 6 — synthesize-speech API (real-time) | Short-text synthesis |77| Step 7 — start-speech-synthesis-task (async to S3) | Long-text batch synthesis |78| Step 8 — Output format and sample rate | Audio encoding |79| Step 9 — CloudWatch metrics | Monitoring |80| Step 10 — Pricing per character | Cost budgeting |81| Step 11 — Recent features | Latest |82| NEVER do these things | Review before signing off |83| Output format | The literal checklist template |84| references/engine-and-voice-selection.md | Engine + voice detail |85| references/ssml-and-lexicons.md | SSML + lexicon detail |8687## Mindset8889**One-line takeaway:** Amazon Polly converts text to speech using90four engine types. Neural voices are higher quality but cost roughly914x standard per character. SSML break and emphasis tags only work92with the standard engine. Lexicons map custom words to phonetic93equivalents. Speech marks are generated as a separate request and94returned as JSON line-delimited timestamps aligned to the audio.9596Three misconceptions dominate Polly misdeployment at provisioning97time:9899> Moved to [references/advanced-patterns.md](references/advanced-patterns.md#common-misconceptions-from-mindset).100> Three Polly misconceptions: neural SSML support, text-length limits, speech-mark delivery.101102## Configuration dependency graph (novel heuristic)103104> Moved to [references/advanced-patterns.md](references/advanced-patterns.md#configuration-dependency-graph-sequencing-notes).105> How to sequence deployment using the dependency graph.106107| Configuration | Hard dependencies (API error without) | Silent failure / immutability | Enables downstream |108|---|---|---|---|109| Engine selection | — (any engine can be chosen) | SSML `<break>` and `<emphasis>` silently ignored by neural/long-form/generative | voice list (per-engine voices differ) |110| Voice ID | engine must support the voice | requesting a standard-only voice with neural returns InvalidParameterValue | language and locale |111| Output format | — | pcm requires 8000/16000 sample rate; mp3/ogg support 22050/24000 | audio encoding |112| Sample rate | must be valid for output format | requesting 24000 with pcm silently coerces or errors | audio quality |113| Lexicon upload | lexicon Name must be unique in account+region | lexicon referenced in synthesis but not uploaded → synthesis fails with LexiconNotFound | custom pronunciation |114| SSML input | must be well-formed XML | `<break>`/`<emphasis>` silently ignored by neural engine | prosody control |115| Speech marks | separate synthesize-speech call with OutputFormat=json | requesting speech marks with OutputFormat=mp3 returns no marks | lip-sync / captioning |116| Async task (S3) | S3 bucket exists and Polly has WriteS3 access | task fails if S3 permissions missing; check task status | batch synthesis |117118> Moved to [references/advanced-patterns.md](references/advanced-patterns.md#cross-dependency-gotchas).119> Baseline-miss rows and gotchas: engine/voice subsets, engine SSML support, format-rate coupling, separate marks call, per-region lexicons.120121## Expert heuristic: engine selection decision tree122123> Moved to [references/advanced-patterns.md](references/advanced-patterns.md#expert-heuristic-engine-selection-decision-tree).124> Engine selection balancing SSML needs, voice availability, and cost.125126## Expert heuristic: real-time vs async synthesis127128> Moved to [references/advanced-patterns.md](references/advanced-patterns.md#expert-heuristic-real-time-vs-async-synthesis).129> Real-time vs async path by text length and latency needs; marks are a separate request.130131## Expert heuristic: pricing per character across engines132133> Moved to [references/advanced-patterns.md](references/advanced-patterns.md#expert-heuristic-pricing-per-character-across-engines).134> Per-character pricing by engine with cost estimation and billing rules.135136## Prerequisites (verify before deployment)137138Before emitting deployment commands, verify these prerequisites. If139any are missing, the verdict is **PREREQUISITES_MISSING**.140141| Prerequisite | Why it matters | How to verify |142|---|---|---|143| Input text available | Polly synthesizes from text input | Confirm text source and encoding (UTF-8) |144| Engine selected | Determines voice availability, SSML support, and cost | Decide: standard, neural, long-form, generative |145| Voice ID identified | Must be valid for the selected engine | `aws polly describe-voices --engine <engine>` |146| Language/locale matched | Voice must match the input text language | `aws polly describe-voices --language-code en-US` |147| Output format chosen | mp3, ogg_vorbis, pcm, or json (speech marks) | Decide based on downstream player |148| Sample rate valid for format | pcm = 8000/16000; mp3/ogg = 22050/24000 | Match format to rate |149| SSML tags engine-compatible | `<break>`/`<emphasis>` only work with standard engine | Verify engine if SSML uses these tags |150| S3 output bucket (async task) | Batch synthesis writes to S3 | `aws s3 ls s3://<bucket>` |151| IAM permissions | polly:SynthesizeSpeech or polly:StartSpeechSynthesisTask | Verify IAM policy |152| Lexicon uploaded (if referenced) | Lexicon must exist before synthesis calls it | `aws polly list-lexicons` |153154If any prerequisite is missing, output `VERDICT: PREREQUISITES_MISSING`155and cite the specific gap.156157## Step 1 — Engine selection (standard vs neural vs long-form vs generative)158159Amazon Polly offers four TTS engines. Each has different quality,160voice availability, SSML support, and pricing.161162| Engine | Quality | Voice availability | SSML support | Cost (per 1M chars) |163|---|---|---|---|---|164| standard | Good | ALL voices (all languages) | Full SSML (`<break>`, `<emphasis>`, `<prosody>`, `<phoneme>`, `<say-as>`) | $4.00 |165| neural | High | Subset of voices | Partial (`<prosody>`, `<phonome>`, `<say-as>`; NOT `<break>`, `<emphasis>`) | $16.00 |166| long-form | Highest (narrative) | Small subset (long-form-optimized voices) | Partial (`<prosody>`; NOT `<break>`, `<emphasis>`) | $100.00 |167| generative | Highest (conversational) | Small subset (generative voices) | Partial (`<prosody>`; NOT `<break>`, `<emphasis>`) | $120.00 |168169**Critical SSML constraint:** the `<break>` and `<emphasis>` tags170are ONLY processed by the standard engine. Neural, long-form, and171generative engines silently ignore these tags. If the use case172requires precise pause control, the standard engine is mandatory.173174> Moved to [references/diagnostic-commands.md](references/diagnostic-commands.md#step-1-engine-and-voice-discovery-commands).175> describe-voices listings per engine for voice discovery.176177## Step 2 — Voice selection by language178179Each Polly voice is identified by a Voice ID (e.g., `Joanna`,180`Matthew`, `Lupe`). Voices are language-specific. Not all voices181are available for all engines.182183| Language code | Example voices | Neural available |184|---|---|---|185| en-US | Joanna, Matthew, Stephen, Kevin, Danielle, Gregory | Yes (Joanna, Matthew, Stephen, Kevin, Danielle, Gregory) |186| en-GB | Amy, Emma, Brian | Yes (Amy, Emma, Brian) |187| en-AU | Nicole, Olivia | Yes (Nicole, Olivia) |188| es-US | Lupe, Miguel, Penelope, Lucia, Diego | Partial (Lupe, Lucia, Diego) |189| fr-FR | Lea, Remi | Yes (Lea, Remi) |190| de-DE | Vicki, Daniel | Yes (Vicki, Daniel) |191| ja-JP | Kazuha, Tomoko | Partial |192| ko-KR | Seoyeon | Yes |193| zh-CN | Zhiyu | Yes |194195> Moved to [references/diagnostic-commands.md](references/diagnostic-commands.md#step-2-voice-discovery-by-language-commands).196> describe-voices by language-code and per-voice neural support check.197198**Select a voice that:**1991. Matches the input text language (language-code).2002. Is available on the chosen engine.2013. Has the desired gender and style.202203## Step 3 — SSML processing (phoneme, emphasis, break, prosody)204205SSML (Speech Synthesis Markup Language) provides fine-grained control206over pronunciation, pacing, emphasis, and prosody. Polly supports a207subset of SSML tags.208209| SSML tag | Purpose | Engine support |210|---|---|---|211| `<break>` | Insert a pause (e.g., `<break time="500ms"/>`) | Standard ONLY |212| `<emphasis>` | Emphasize a word (e.g., `<emphasis level="strong">important</emphasis>`) | Standard ONLY |213| `<prosody>` | Control rate, pitch, volume (e.g., `<prosody rate="slow">text</prosody>`) | ALL engines |214| `<phoneme>` | Phonetic pronunciation via IPA (e.g., `<phoneme alphabet="ipa" ph="ˈtɒmɑtəʊ">tomato</phoneme>`) | Standard + Neural |215| `<say-as>` | Interpret text type (e.g., `<say-as interpret-as="date" format="mdy">01/15/2024</say-as>`) | ALL engines |216| `<speak>` | Root SSML element (wraps all SSML) | ALL engines |217| `<sub>` | Substitute pronunciation (e.g., `<sub alias=" Avenue">Ave</sub>`) | Standard + Neural |218| `<w>` | Part-of-speech override | Standard + Neural |219| `<amazon:effect>` | Whisper, dynamical range compression | Standard + Neural |220221> Moved to [references/ssml-and-lexicons.md](references/ssml-and-lexicons.md#step-3-ssml-examples-standard-vs-neural).222> Full-tag SSML for standard engine; prosody/phoneme-only SSML for neural.223224**Critical:** if the SSML uses `<break>` or `<emphasis>` and the225engine is neural/long-form/generative, the tags are silently ignored.226The synthesis succeeds but the pauses and emphasis do not appear in227the output audio. This is the #1 Polly deployment surprise.228229## Step 4 — Lexicon management (custom pronunciation)230231Lexicons (PLS — Pronunciation Lexicon Specification) allow custom232pronunciation mappings. A lexicon maps a word to its phonetic233equivalent so that Polly pronounces it correctly every time.234235**Lexicon use cases:**236- Company names, product names, and acronyms.237- Domain-specific terminology (medical, legal, technical).238- Regional pronunciation variants.239240> Moved to [references/ssml-and-lexicons.md](references/ssml-and-lexicons.md#step-4-lexicon-management-commands).241> PLS lexicon file, put-lexicon upload, lexicon use in synthesis, list/get verification, constraints.242243## Step 5 — Speech marks (lip-sync alignment)244245Speech marks are timestamp-aligned markers that map text positions246to audio positions. They are essential for lip-sync animation,247captioning, and highlighting text as audio plays.248249**Speech mark types:**250251| Type | Description | Use case |252|---|---|---|253| `viseme` | Visual mouth-shape codes for animation | 3D avatar lip-sync |254| `word` | Word-level start/end timestamps | Text highlighting, caption sync |255| `sentence` | Sentence boundaries | Caption segmentation |256| `ssml` | SSML tag timestamps | SSML mark navigation |257258> Moved to [references/worked-examples.md](references/worked-examples.md#step-5-speech-marks-generation-and-output).259> Speech-mark synthesis command, line-delimited JSON output, and field semantics.260261**Critical:** speech marks are generated as a SEPARATE call from the262audio. The audio synthesis (OutputFormat=mp3) and the marks263synthesis (OutputFormat=json) must use the SAME engine, voice, text,264sample rate, and lexicons for the timestamps to align correctly.265266## Step 6 — synthesize-speech API (real-time)267268The `synthesize-speech` API is the real-time synthesis endpoint. It269returns the audio stream directly in the HTTP response. Use for270short text (under ~3000 characters) where low latency is required.271272> Moved to [references/worked-examples.md](references/worked-examples.md#step-6-synthesize-speech-real-time-examples).273> Plain-text, SSML, and lexicon real-time synthesis invocations.274275**API constraints:**276- Maximum input text length: ~3000 characters (varies by configuration).277- Returns audio as a binary stream in the response body.278- Synchronous — the caller waits for synthesis to complete.279- Latency: typically 200-600ms for neural, 100-300ms for standard.280281## Step 7 — start-speech-synthesis-task (async to S3)282283The `start-speech-synthesis-task` API is the asynchronous synthesis284endpoint for long text. It writes the output audio file to a285specified S3 bucket. Use for batch processing, long-form content286(articles, books), and pre-generation of audio assets.287288> Moved to [references/worked-examples.md](references/worked-examples.md#step-7-async-synthesis-task-commands).289> start-speech-synthesis-task with S3 output, status check, and task listing.290291**Task lifecycle:**292- `scheduled` → `queued` → `inProgress` → `completed` | `failed`293- On completion, the audio file is available at the S3 URI:294 `s3://<bucket>/<key-prefix>/<task-id>.mp3`295296**S3 IAM permissions required:**297Polly needs `s3:PutObject` on the output bucket. The service-linked298role `PollySynthesisTaskServiceRole` is typically auto-managed.299300> Moved to [references/diagnostic-commands.md](references/diagnostic-commands.md#step-7-verify-async-task-s3-output).301> S3 listing check for the completed async synthesis output.302303## Step 8 — Output format and sample rate304305Output format and sample rate are coupled. Not all combinations are306valid.307308| Output format | Valid sample rates | Use case |309|---|---|---|310| mp3 | 22050, 24000 | General-purpose audio playback |311| ogg_vorbis | 22050, 24000 | Web audio, streaming |312| pcm | 8000, 16000 | Telephony, raw audio processing |313| json | N/A (speech marks only) | Speech marks / lip-sync |314315> Moved to [references/worked-examples.md](references/worked-examples.md#step-8-output-format-and-sample-rate-examples).316> Telephony PCM 8000 Hz and high-quality MP3 24000 Hz synthesis.317318**Mismatching format and sample rate** (e.g., PCM at 24000 Hz) will319produce an error or silently coerce the output.320321## Step 9 — CloudWatch metrics322323Polly publishes metrics to CloudWatch for monitoring synthesis324volume, errors, and latency.325326| Metric | Description |327|---|---|328| `RequestCharacters` | Total characters processed (for billing estimation) |329| `ResponseLatency` | Average synthesis latency |330| `2XXCount` / `4XXCount` / `5XXCount` | HTTP response code counts |331| `ThrottledCount` | Throttled request count (if exceeding limits) |332333> Moved to [references/diagnostic-commands.md](references/diagnostic-commands.md#step-9-cloudwatch-metrics-commands).334> get-metric-statistics for RequestCharacters and a character-budget billing alarm.335336## Step 10 — Pricing per character337338Polly pricing is per-character of input text. SSML tags are NOT339counted — only the text content between tags.340341| Engine | Price per 1M characters (us-east-1) | Notes |342|---|---|---|343| standard | $4.00 | All voices, full SSML |344| neural | $16.00 | 4x standard; subset of voices |345| long-form | $100.00 | Audiobook-quality narration |346| generative | $120.00 | Most expressive conversational voices |347348> Moved to [references/diagnostic-commands.md](references/diagnostic-commands.md#step-10-pricing-estimation-commands).349> Character-count and monthly cost estimation one-liners.350351**Free tier:** 5 million characters per month for standard voices,3521 million characters per month for neural voices (for the first 12353months).354355## Step 11 — Recent features356357> Moved to [references/advanced-patterns.md](references/advanced-patterns.md#step-11-recent-features).358> Recent AWS features (2023-2026): generative engine, long-form enhancements, neural expansion, enhanced metrics, SSE-KMS, viseme improvements.359360## NEVER do these things3613621. **NEVER use `<break>` or `<emphasis>` SSML tags with neural,363 long-form, or generative engines.** These tags are ONLY processed364 by the standard engine. Neural and others silently ignore them.365 If the use case requires pause control, use standard engine or366 `<prosody rate>` for timing adjustment.3673682. **NEVER assume speech marks are returned with the audio.** Speech369 marks are a SEPARATE `synthesize-speech` call with370 `OutputFormat=json` and `SpeechMarkTypes` specified. The audio371 and marks are two different requests.3723733. **NEVER use `synthesize-speech` for long text (>3000 chars).**374 The real-time API has a payload limit. For longer text, use375 `start-speech-synthesis-task` which writes to S3 and handles376 arbitrarily long input.3773784. **NEVER request a sample rate incompatible with the output379 format.** PCM supports only 8000 and 16000 Hz. MP3 and OGG380 support 22050 and 24000 Hz. Mismatching produces errors or381 silent coercion.3823835. **NEVER assume all voices are available on all engines.** Neural,384 long-form, and generative each support a SUBSET of the standard385 voice catalog. Always verify with `describe-voices --engine`.3863876. **NEVER assume lexicons are global.** Lexicons are per-region.388 A lexicon uploaded in us-east-1 is NOT available in eu-west-1.389 Upload to each region where needed.3903917. **NEVER forget to verify the S3 output for async tasks.** The392 task may fail due to IAM permissions or bucket policy. Always393 check `get-speech-synthesis-task` status and verify the S3394 object exists.3953968. **NEVER estimate cost without checking the engine rate.** Neural397 is 4x standard, long-form is 25x standard, generative is 30x398 standard. High-volume workloads must budget by engine.3994009. **NEVER use PCM output for web playback.** PCM is raw, unheadered401 audio. Use MP3 or OGG for web and mobile applications. PCM is402 for telephony and audio processing pipelines.40340410. **NEVER reference a lexicon before uploading it.** The synthesis405 call will fail with `LexiconNotFound`. Always `put-lexicon`406 before referencing it in `synthesize-speech`.407408## Output format409410```text411POLLY_VOICE: <voice-id> (<engine> engine, <language-code>)412VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING413CHECKLIST:414 [✓|✗] Engine: standard | neural | long-form | generative415 [✓|✗] Voice: <voice-id> (<language-code>, <gender>)416 [✓|✗] Voice available on engine: PASS | FAIL (voice not supported)417 [✓|✗] SSML compatibility: <tags used> — PASS (all tags supported) | FAIL (<break>/<emphasis> not supported on neural)418 [✓|✗] Output format: mp3 | ogg_vorbis | pcm | json419 [✓|✗] Sample rate: <rate> Hz — PASS (valid for format) | FAIL (invalid for format)420 [✓|✗] Lexicon: <name> — uploaded | not referenced421 [✓|✗] Synthesis mode: real-time (synthesize-speech) | async (start-speech-synthesis-task → s3://<bucket>/<key>)422 [✓|✗] Speech marks: <types> (separate request) | not required423 [✓|✗] Estimated cost: $<amount> (<char-count> chars × $<rate>/1M)424 [✓|✗] Tags: <key=value list>425VERIFICATION_COMMANDS:426 aws polly describe-voices --engine <engine> --query 'Voices[?Id==`<voice-id>`]'427 aws polly list-lexicons --query 'Lexicons[?Name==`<lexicon>`]'428 aws polly get-speech-synthesis-task --task-id <task-id>429```430431### Worked example — neural voice real-time synthesis432433```text434POLLY_VOICE: Joanna (neural engine, en-US)435VERDICT: READY_TO_DEPLOY436CHECKLIST:437 [✓] Engine: neural438 [✓] Voice: Joanna (en-US, Female)439 [✓] Voice available on engine: PASS (Joanna supports neural)440 [✓] SSML compatibility: plain text (no SSML) — PASS441 [✓] Output format: mp3442 [✓] Sample rate: 24000 Hz — PASS (valid for mp3)443 [✓] Lexicon: company-terms — uploaded444 [✓] Synthesis mode: real-time (synthesize-speech)445 [✓] Speech marks: not required446 [✓] Estimated cost: $0.00 (52 chars × $16/1M = $0.000832)447 [✓] Tags: Environment=production, UseCase=greeting448VERIFICATION_COMMANDS:449 aws polly describe-voices --engine neural --query 'Voices[?Id==`Joanna`]'450 aws polly list-lexicons --query 'Lexicons[?Name==`company-terms`]'451```452453## Error handling454455> Moved to [references/error-handling.md](references/error-handling.md#error-handling).456> Symptom-by-symptom fixes: missing pauses, S3 access denied, voice/lexicon not found, empty marks, garbled PCM.457## References (load on demand)458459- [advanced-patterns](references/advanced-patterns.md) — expert-heuristic deep dives, misconceptions, dependency-graph notes, recent AWS features (2023-2026)460- [worked-examples](references/worked-examples.md) — filled-in synthesis examples (speech marks, real-time, async, output formats)461- [diagnostic-commands](references/diagnostic-commands.md) — voice discovery, task verification, CloudWatch, and pricing commands462- [error-handling](references/error-handling.md) — symptom-by-symptom troubleshooting463- [engine-and-voice-selection](references/engine-and-voice-selection.md) — engine and voice selection detail (existing)464- [ssml-and-lexicons](references/ssml-and-lexicons.md) — SSML and lexicon detail plus examples (existing)465466## Domain467468AWS CloudOps / Amazon Polly Text-to-Speech Configuration & Voice469Synthesis Deployment.470471## AWS documentation472473- **Amazon Polly Developer Guide** — https://docs.aws.amazon.com/polly/latest/dg/what-is.html474- **Synthesize speech** — https://docs.aws.amazon.com/polly/latest/dg/API_SynthesizeSpeech.html475- **Start speech synthesis task** — https://docs.aws.amazon.com/polly/latest/dg/API_StartSpeechSynthesisTask.html476- **SSML tags** — https://docs.aws.amazon.com/polly/latest/dg/ssml.html477- **Lexicons** — https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html478- **Speech marks** — https://docs.aws.amazon.com/polly/latest/dg/speechmarks.html479- **Voice list** — https://docs.aws.amazon.com/polly/latest/dg/voicelist.html480- **Engine types** — https://docs.aws.amazon.com/polly/latest/dg/choosing-the-engine.html481- **Pricing** — https://aws.amazon.com/polly/pricing/482- **CloudWatch metrics** — https://docs.aws.amazon.com/polly/latest/dg/cloudwatch-monitoring.html