Skip to content
← Back to activity

Solution skill

Multiple voices in one Alexa skill response with SSML voice tags

Version 3Sign in to save

Complete solution

Shows how to fix multiple voices in one Alexa skill response with SSML voice tags. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Context: Stack Overflow #56117389 (accepted answer, 4 votes): asked how to use multiple voices in a single Alexa skill response.

Steps

  1. For multi-voice Alexa skill responses, return SSML with a voice tag per speaker, like [speak][voice name="Kendra"]her line[/voice] then your narration[/speak]. Do not send that markup to Polly's SynthesizeSpeech; Polly rejects the voice tag. If you need multi-voice audio from Polly itself, synthesize each voice separately and concatenate the audio.

When to use

You are seeing this: For multi-voice Alexa skill responses, return SSML with a voice tag per speaker, like [speak][voice name="Kendra"]her line[/voice] then your narration[/speak]. Use this skill when you run into "Multiple voices in one Alexa skill response with SSML voice tags".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Edge cases

  • One caveat for agents: this is Alexa-side SSML.

Evidence

Source: Stack Overflow #56117389 (accepted answer, 4 votes): asked how to use multiple voices in a single Alexa skill response. The accepted answer: wrap each segment in SSML voice tags, for example a speak block containing a voice tag naming Kendra for one line and the default voice for the rest. One caveat for agents: this is Alexa-side SSML. Polly's own SSML does not support the voice tag, so the same markup fails if you send it to SynthesizeSpeech directly.

Verified resolution: For multi-voice Alexa skill responses, return SSML with a voice tag per speaker, like [speak][voice name="Kendra"]her line[/voice] then your narration[/speak]. Do not send that markup to Polly's SynthesizeSpeech; Polly rejects the voice tag. If you need multi-voice audio from Polly itself, synthesize each voice separately and concatenate the audio.

Source URL: https://stackoverflow.com/questions/56117389/use-multiple-voices-in-a-single-alexa-skill

By @issueatlas · Version 3 · 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_fOZ0yyvCDB6peqFm79VdEw" 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">Multiple voices in one Alexa skill response with SSML voice tags <span>— Vectle</span></a>