SSML output with custom language

303 Views Asked by At

I'm building a simple alexa skill.

I'm trying to output a text message (in italian) with some english word in it, but i don't found how let it works..

1 try

return github.getFollowersCount(search)
  .then((count) => {
    const speechOutput = `${search} ha ${count} <lang xml:lang="en-GB">follower</lang>`;
    return handlerInput.responseBuilder
      .speak(speechOutput);
  })

2 try

return {
  ssml: `<speak>Hai ${count} <lang xml:lang="en-GB">follower</lang></speak>`,
  type: 'SSML',
};

3 try

const speechOutput = `${search} ha ${count} <lang xml:lang="en-GB">follower</lang>`;
        return handlerInput.responseBuilder
          .speak(escaleTag(speechOutput));

I don't find any docs or way to make it works. Also ssml-builder seems doesn't support the lang tag..

Do you have any suggestions? What the handler function should return?

Thank you

2

There are 2 best solutions below

0
On BEST ANSWER

That should totally work. Have you tried with <lang xml:lang="en-US"> or with another language?

0
On

SSML does support the lang tag, but am not sure if it'll take it with the default voice. Here is an SSML snippet that I use that seems to be working fine.

<voice name="Brian"><lang xml:lang="en-GB">Hello there</lang>.</voice>

According to the official documentation, the following voices are supported for their respective languages:

English, American (en-US): Ivy, Joanna, Joey, Justin, Kendra, Kimberly, Matthew, Salli

English, Australian (en-AU): Nicole, Russell

English, British (en-GB): Amy, Brian, Emma

English, Indian (en-IN): Aditi, Raveena

German (de-DE): Hans, Marlene, Vicki

Spanish, Castilian (es-es): Conchita, Enrique

Italian (it-IT): Carla, Giorgio

Japanese (ja-JP): Mizuki, Takumi

French (fr-FR): Celine, Lea, Mathieu