2

SSML in action on google node.js is not working. It simply tells the value along with SSML tag.

Example: <speak> Hello <break time="1s"/> All </speak> It simply tells that the tag like "less than speak greater than hello less than break time equal to......."

Sudhakar
  • 533
  • 1
  • 3
  • 17

2 Answers2

0

Let say you are using action-on-google npm package.

You can refer code below,

// Handle the Dialogflow intent named 'favorite color'.
// The intent collects a parameter named 'color'
app.intent('favorite color', (conv, {color}) => {
 const luckyNumber = color.length;
 const audioSound = 'https://actions.google.com/sounds/v1/cartoon/clang_and_wobble.ogg';
 if (conv.data.userName) {
   // If we collected user name previously, address them by name and use SSML
   // to embed an audio snippet in the response.
   conv.close(`<speak>${conv.data.userName}, your lucky number is ` +
     `${luckyNumber}.<audio src="${audioSound}"></audio></speak>`);
 } else {
   conv.close(`<speak>Your lucky number is ${luckyNumber}.` +
     `<audio src="${audioSound}"></audio></speak>`);
 }
});

For more details, you can checkout Google Code Lab

Gautam
  • 536
  • 4
  • 14
0

Check your tags there might be some error in that.I had the same problem it turned out that that I missed the forward slash in break time.You might have made some mistakes like that.

Aditya Roy
  • 45
  • 8
  • This better post as a comment instead of an answer. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker.](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead) – Til Apr 08 '19 at 03:03