Using two voice-ids / two voice types on Amazon Polly

1k views Asked by At

I'm trying to work with Amazon Polly to create a sample dialogue between two individuals for my web app.

The documentation shows ways to import any phrases using their markup language, but I'm not seeing any examples that allow you to pass multiple voice-ids

aws polly synthesize-speech \
--text-type ssml \
--text '<speak>Hello, how are you?</speak>' --voice-id Joanna \
--text '<speak>I am well.</speak>' --voice-id Miguel \
--output-format mp3 \
dialogue.mp3

Has anyone worked with Amazon Polly before to do two voices? Can you share sample code if so? Thanks so much!

1

There are 1 answers

0
user650881 On

To my knowledge AWS Polly SSML does not currently support independent voice-ids in a single rendering. I believe you would need to render each voice separately and sequence them during playback.

This might not be as much of an extra burden as you might expect as you may find that the API length limits also require that you split apart long text into smaller pieces anyway.