node.jsalexa-skills-kitjovo-framework

Use multiple voices in a single Alexa skill?


I would like to use multiple Alexa voices in a single skill. Is this possible?

I know there is Amazon Polly, but what SSML do you use to use the different characters. I've tried looking online and I've come up with nothing.

let speech = '<speak>Your name is Tim. /*After this I want a different voice*/ You have decided to sneak into a haunted house with your cousin Sally. You used a ladder to barely heave yourself over the rusty 12 foot tall iron gate. You were able to get in, but can you get out?';

I want the "You name is Tim" to be in a different voice than the rest of the sentence.


Solution

  • Use the <voice> tag. Options are listed here

    let speech = '<speak><voice name="Kendra">Your name is Tim.</voice> You have decided to sneak into a haunted house with your cousin Sally. You used a ladder to barely heave yourself over the rusty 12 foot tall iron gate. You were able to get in, but can you get out?</speak>';