node.jsalexa-skills-kitssml

SSML output with custom language


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


Solution

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