Amazon Polly - Single script switching voices?

I can find some online help that suggests that I can use the tags and to have a text with more than one voice in it (i.e. a male and female narrator switching back and forth for an intro). However using Polly from the console, that give me an SSML syntax error. Is the problem that I’m trying to do this from the console? If so, is there another way to submit a script short of building a program for each episode?


Related discussions:

Where is this ‘online help’?

I don’t see any mention of Voice in Polly’s developer guide. https://docs.aws.amazon.com/polly/latest/dg/supportedtags.html

Seems this is not supported.

Can you tell me a bit more about your use case?

Search result had taken me here:
https://developer.amazon.com/docs/custom-skills/speech-synthesis-markup-language-ssml-reference.html

But looking at this more closely this appears to be for using Alexa to operate Polly. So maybe there’s some way to do that but still create an MP3 file?

Sure - am basically working on a series of topics that I want to present using a male and a female narrator. So have a script, and the two each have some of the lines. I can obviously just break the script down into the Male narrator pieces and the Female narrator pieces, but it would be more convenient to just keep the script as one piece and direct the Polly service to have the MP3 created with both voices in the file.

So if I have:

Matthew - “This week we’re going to be discussing Seldonian Algorithms”

Joanna - “An example of a Seldonian algorithm would be to create a constraint specifying that in solving for a diabetes treatment that dangerously low blood sugar, or hypoglycemia is an undesirable outcome.”

In that example I can obviously put the Matthew text into the console, download the MP3, then click to change the voice, put the Joanna text into the console, and then download that MP3.

However that means that every time I am changing the narrator I have to go through the click, paste, download, click process. Ideally I could simply annotate a single script and then download the one MP3.

Make sense?

I’m obviously very, very late to the discussion, but I wonder, did you ever find a solution to this problem? I know it has been a few years, but I have searched for an answer and came across your post. I haven’t been able to identify any other information and wondered if you had ever managed to sort this out? If so, would you be willing to share a script that works?

I’m looking for the information, too, if anyone has managed to sort out how to do it.

And, after some extensive digging tonight, I think I found it for anyone else still looking. Haven’t tested it myself, yet, but this seems to provide a solution:

https://docs.plumvoice.com/dev/developer-reference/tts-engine-characteristics/amazon-polly-tts-engine/polly-voice-tag-attribute-details

Hi! Does it work for you? I try it on Polly console but doesn’t work. I’ll have to do it on python ?

Simple exemple :

Bonjour

Hello

Hello

Much of the SSML on works with the Standard voice, and not with the other three types of generation.

How about just generating separate mp3 files for each voice and then stitching them together with an audio edit utility?