3

I have integrated my dialogflow agent with google assistant. There is a welcome intent that will ask you to choose any of the option

Choose any of the sports 1. NBA 2. NHL 3. FIH

It reads the response with ever individual words(as an abbreviation). But when I produce the same in response from webhook, it is not reading the response with individual words(or not considering the response as abbreviation) and reads together. How can I achieve this? Am I missing something in the response?

2 Answers 2

3

You likely want to make sure you're sending back SSML in your response, rather than sending back text and letting it convert it to speech, and specifically marking the abbreviations using the <say-as> tag and telling it to interpret the contents as characters.

So you might send it back as something like:

<speak>
  Are you interested in learning more about 
  the <say-as interpret-as="characters">NBA</say-as>,
  the <say-as interpret-as="characters">NHL</say-as>
  or the <say-as interpret-as="characters">FIH</say-as>?
</speak>
0
0

The little pronunciation differences with and without SSML are serious problems. I stick in a speak /speak for everything. Also a unique number I like and a test hook to have speech 'count' or not so there is a way to test things. Also a hook so an intent is triggered for 'repeat that please' :

Point is to use sayUsual for everything ordinary.

// Mostly SSML start char kit as globals
  const startSp = "<speak>", endSp = "</speak>";

// Handle "Can you repeat that ?" well
  var vfSpokenByMe = "";

// VF near globals what was said, etc
  var repeatPossible = {}; repeatPossible.vf = ""; repeatPossible.n = 0;

// An answer from this app to the human in text
  function absorbMachineVf( intentNumber, aKind, aStatement )
  {
    // Numbers reserved for 'repeats'
    if( intentNumber > 9000 ) { return; }

    // Machine to say this, a number for intents too
    repeatPossible.vf = aStatement; repeatPossible.n = intentNumber;
  }


// Usual way to say a thing
  function sayUsual( n, speechAgent, somethingToSay )
  {
    // Work with an answer of any sort
    absorbMachineVf( n, 'usual', somethingToSay );

    // Sometimes we are just pretending, so
    if( !testingNow )
    { speechAgent.add( startSp + somethingToSay + endSp ); }

    // Make what we said as an answer available 'for sure' to rest of code
    vfSpokenByMe = somethingToSay;                            // Even in simulation
  }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.