Skip to main content

prompt

Play a prompt and wait for digit or speech input. Speech detection is not enabled unless at least one speech parameter is set. If only speech parameters are set (and no digit parameters), digit detection is not enabled. To enable both digit and speech detection, set at least one parameter for each.

Parameters

NameTypeDescription
playstring | string[]URL or array of URLs to play. Allowed URLs are:
  • http:// - audio file to GET
  • https:// - audio file to GET
  • ring:[duration:]<country code> - ring tone to play. For example: ring:us to play single ring or ring:20.0:us to play ring for 20 seconds.
  • say:<text to speak> - Sentence to say
  • silence:<duration> - seconds of silence to play
volumenumberOptional volume gain to apply to played URLs. Allowed values from -40.0 to 40.0. Default 0.
say_voicestringOptional voice to use with say: for text to speech. Default is Default is Polly.Salli.
say_languagestringOptional language to use with say: for text to speech. Default is en-US.
say_genderstringOptional gender to use with say: for text to speech. Default is female.
max_digitsintegerOptional number of digits to collect. Default 1.
terminatorsstringOptional digits that terminate digit collection. Default unset.
digit_timeoutnumberOptional time in seconds to wait for next digit. Default 5.0.
initial_timeoutnumberOptional time in seconds to wait for start of input. Default 5.0.
speech_timeoutnumberOptional max time in seconds to wait for speech result. Default unset.
speech_end_timeoutnumberOptional time in seconds to wait for end of speech utterance. Default unset.
speech_languagestringOptional language to detect speech in.
speech_hintsstring[]Optional expected words to match.

Variables

Read by the method:

  • say_voice: (in) - optional voice to use for text to speech.
  • say_language: (in) - optional language to use for text to speech.
  • say_gender: (in) - optional gender to use for text to speech.

Supported Voices and Languages

To learn more about the supported voices and languages, please visit the Supported Voices and Languages Documentation.

Supported Ring tones

Parameter
urls.ringAvailable values are the following
ISO 3166-1 alpha-2 country codes: at, au, bg, br,
be, ch, cl, cn, cz, de, dk, ee, es, fi, fr, gr, hu, il, in,
it, lt, jp, mx, my, nl, no, nz, ph, pl, pt, ru, se, sg, th,
uk, us, us-old, tw, ve, za.

Set by the method

  • prompt_result: (out) - failed, no_input, match_speech, match_digits, or no_match.
  • prompt_value: (out) - the digits or utterance collected.
  • return_value: (out) - the same as prompt_value.
  • prompt_digit_terminator: (out) - digit terminator collected, if any.
  • prompt_speech_confidence: (out) - speech confidence measured, if any.

Examples

Play prompt and wait for digit press

version: 1.0.0
sections:
main:
- label: welcome
prompt:
play: https://example.com/menu.wav
- switch:
case:
1:
- transfer: https://example.com/sales.swml
variable: prompt_value
default:
- play: https://example.com/bad_input.wav
- transfer: main

Play prompt and wait for digit or speech

version: 1.0.0
sections:
main:
- label: welcome
prompt:
play: https://example.com/press_or_say_one.wav
speech_language: en-US
max_digits: 1
speech_hints:
- one
- two
- three
- four
- five
- six
- seven
- eight
- nine
- switch:
case:
1:
- transfer: https://example.com/sales.swml
one:
- transfer: https://example.com/sales.swml
variable: prompt_value
default:
- play: https://example.com/bad_input.wav
- transfer: main

Play prompt and collect digits, then pass the data to an external action

version: 1.0.0
sections:
main:
- prompt: https://example.com/menu.wav
- transfer: https://example.com/post_next_menu