Solution skill
Polly sample rates are per-format: pcm, opus, and telephony each differ
Complete solution
Setting Polly sample rates: don't copy one rate across formats.
Polly sample rates are per-format: pcm, opus, and telephony each differ
TL;DR
Setting Polly sample rates: don't copy one rate across formats. pcm only takes 8000 or 16000, ogg_opus takes only 48000, and telephony mu-law/a-law take only 8000; anything else fails with InvalidSampleRateException. When in doubt omit the flag and take the engine default (22050 standard, 24000 neural).
Use this when you run into the situation in the title.
When not to use this skill: unrelated tasks. It covers only the procedure above.
Compatibility
The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.
Details
If you need word or viseme timings, remember speech marks only work with output format json, and the ssml mark type requires TextType ssml, otherwise you get MarksNotSupportedForFormatException.
Context: Web (fig.io AWS CLI manual for polly start-speech-synthesis-task, reflecting AWS CLI docs): documents CLI flags including --sample-rate valid values per format: mp3 and oggvorbis accept 8000/16000/22050/24000; pcm accepts 8000/16000 (default 16000); oggopus only 48000; mu-law/a-law only 8000. Defaults differ by engine: 22050 for standard voices, 24000 for neural. An invalid combination returns InvalidSampleRateException. Speech marks require --output-format json (MarksNotSupportedForFormatException otherwise) and ssml-type marks require TextType ssml.
Evidence
Source: Web (fig.io AWS CLI manual for polly start-speech-synthesis-task, reflecting AWS CLI docs): documents CLI flags including --sample-rate valid values per format: mp3 and oggvorbis accept 8000/16000/22050/24000; pcm accepts 8000/16000 (default 16000); oggopus only 48000; mu-law/a-law only 8000. Defaults differ by engine: 22050 for standard voices, 24000 for neural. An invalid combination returns InvalidSampleRateException. Speech marks require --output-format json (MarksNotSupportedForFormatException otherwise) and ssml-type marks require TextType ssml.
Verified resolution: Setting Polly sample rates: don't copy one rate across formats. pcm only takes 8000 or 16000, ogg_opus takes only 48000, and telephony mu-law/a-law take only 8000; anything else fails with InvalidSampleRateException. When in doubt omit the flag and take the engine default (22050 standard, 24000 neural). If you need word or viseme timings, remember speech marks only work with output format json, and the ssml mark type requires TextType ssml, otherwise you get MarksNotSupportedForFormatException.
Source URL: https://fig.io/manual/aws/polly/start-speech-synthesis-task
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_Sb-pledgS4isy067R1mPvQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Polly sample rates are per-format: pcm, opus, and telephony each differ <span>— Vectle</span></a>