Tropo is part of CiscoLearn More

say

Says something to the user. Unlike "ask", this function has no ability to wait for a response from the user.

On voice sessions, say can play text strings using TTS (text to speech) or play URLs as audio files. See supported audio formats.

On SMS sessions, say will send a text string to the user via SMS.

Fields

value

String
(Required)

This defines what the user will hear when the verb is executed. In the case of a voice channel, this can be text for the Text to Speech engine or a URL to play an audio file. In the case of a text channel, text is sent to the user via SMS or instant message.

allowSignals

String or Array
Default: 
* (any signal)

This parameter allows you to assign a signal to this function. Events from the Tropo REST API with a matching signal name will "interrupt" the function (i.e., stop it from running). If it already ran and completed, your interrupt request will be ignored. If the function has not run yet, the interrupt will be queued until it does run.

By default, allowSignals will accept any signal as valid; if you define allowSignals as an empty string (""), it defines the function as "uninterruptible". You can also use an array - the function will stop if it receives an interrupt signal matching any of the names in the array.

as

String

This specifies the type of data being spoken, so the TTS Engine can interpret it correctly. The possible values are "DATE", "DIGITS" and "NUMBER". Applies to voice only.

name

String
(Required)

This is the key used to identify the result of an operation, so you can differentiate between multiple results. As an example, if you asked the user for their favorite color, you could set the name value as 'color' while the returned value might be 'blue'. Not particularly useful if there's only one result returned, but if there are multiple results it helps to determine which result belonged to which operation.

required

Boolean
Default: 
true

This determines whether Tropo should move on to the next verb; if required is set to 'true', Tropo will only move on to the next verb if the current operation completely successfully.

voice

String
Default: 
allison

Specifies the default voice to be used when speaking text back to a user.

A full list of all voices can be found here (there are many, many options).

promptLogSecurity

String
Default: 
none

Controls whether Tropo logs the text to speech string used by the method. Possible values are "none" (the default) and "suppress", which disables output logging for this method. See Log Suppression for complete details and examples.

Examples

Example showing audio & TTS

{
   "tropo":[
      {
         "say":[
            {
               "value":"Guess what? https://www.tropo.com/docs/troporocks.mp3"
            }
         ]
      }
   ]
}

Example as an Object

{
   "tropo":[{"say":{"value":"Please enter your account number..."}}]
}

Example paired with an event trigger

{
   "tropo":[
      {
         "say":[
            {
               "value":"Success!"
            }
         ]
      },
      {
         "on":{
            "next":"document2.json",
            "event":"continue"
         }
      }
   ]
}

Example including SSML

{
    "tropo": [
        {
            "say": [
                {
                    "value": "<?xml version='1.0'?><speak><say-as interpret-as=\"vxml:currency\">USD51.33</say-as></speak>"
                } 
            ] 
        },
        {
            "say": [
                {
                    "value": "<?xml version='1.0'?><speak><say-as interpret-as=\"vxml:digits\">20314253</say-as></speak>"
                } 
            ] 
        },
        {
            "say": [
                {
                    "value": "<?xml version='1.0'?><speak><say-as interpret-as=\"vxml:number\">2031.435</say-as></speak>"
                } 
            ] 
        },
        {
            "say": [
                {
                    "value": "<?xml version='1.0'?><speak><say-as interpret-as=\"vxml:phone\">4075551212</say-as></speak>"
                } 
            ] 
        },
        {
            "say": [
                {
                    "value": "<?xml version='1.0'?><speak><say-as interpret-as=\"vxml:date\">20090226</say-as></speak>"
                } 
            ] 
        },
        {
            "say": [
                {
                    "value": "<?xml version='1.0'?><speak><say-as interpret-as=\"vxml:time\">0515a</say-as></speak>"
                } 
            ] 
        } 
    ]
}