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
Name | Type | Description |
---|---|---|
play | string | string [] | URL or array of URLs to play. Allowed URLs are:
|
volume | number | Optional volume gain to apply to played URLs. Allowed values from -40.0 to 40.0 . Default 0. |
say_voice | string | Optional voice to use with say: for text to speech. Default is Default is Polly.Salli . |
say_language | string | Optional language to use with say: for text to speech. Default is en-US . |
say_gender | string | Optional gender to use with say: for text to speech. Default is female. |
max_digits | integer | Optional number of digits to collect. Default 1. |
terminators | string | Optional digits that terminate digit collection. Default unset. |
digit_timeout | number | Optional time in seconds to wait for next digit. Default 5.0. |
initial_timeout | number | Optional time in seconds to wait for start of input. Default 5.0. |
speech_timeout | number | Optional max time in seconds to wait for speech result. Default unset. |
speech_end_timeout | number | Optional time in seconds to wait for end of speech utterance. Default unset. |
speech_language | string | Optional language to detect speech in. |
speech_hints | string [] | Optional expected words to match. |
result | object | array | Set up a switch on return_value by using an object or a cond statement by using an array. |
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.
Parameter | ||
---|---|---|
say_voice | The available Amazon Polly voices are here The available Google Cloud voices are here The available Elevenlabs are:
|
|
say_language default: en | arb [Arabic, Modern Standard] ar-AR [Arabic, Modern Standard] ar-XA [Arabic] gcloud bn-IN [Bengali, India] gcloud yue-HK [Chinese, Hong Kong] gcloud cmn-CN [Chinese, Mandarin] gcloud cmn-TW [Chinese, Mandarin] gcloud zh-CN [Chinese, Mandarin] cs-CZ [Czech, Czech Republic] gcloud cy-GB [Welsh, UK] da-DK [Danish, Denmark] de [German, Germany] de-DE [German, Germany] en [English, United States] en-AU [English, Australia] en-CA [English, Canada] en-GB [English, UK] en-GB-WLS [English, Wales] en-IN [English, India] en-US [English, United States] es [Spanish, United States] es-ES [Spanish, Spain] es-MX [Spanish, Mexico] es-US [Spanish, United States] fil-PH [Filipino, Philippines] gcloud fi-FI [Finnish, Finland] gcloud fr [French, France] fr-CA [French, Canada] | fr-FR [French, France] el-GR [Greek, Greece] gcloud gu-IN [Gujarati, India] gcloud hi-IN [Hindi, India] hu-HU [Hungarian, Hungary] gcloud is-IS [Icelandic, Iceland] id-ID [Indonesian, Indonesia] gcloud it [Italian, Italy] it-IT [Italian, Italy] ja-JP [Japanese, Japan] kn-IN [Kannada, India] gcloud ko-KR [Korean, Korea] ml-IN [Malayalam, India] gcloud morse [Morse Code, Dit Dah] nb-NO [Norwegian, Norway] nl-NL [Dutch, Netherlands] pl-PL [Polish, Poland] pt-BR [Portuguese, Brazil] pt-PT [Portuguese, Portugal] ro-RO [Romanian, Romania] ru-RU [Russian, Russia] sk-SK [Slovak, Slovakia] gcloud sv-SE [Swedish, Sweden] ta-IN [Tamil, India] gcloud te-IN [Telugu, India] gcloud th-TH [Thai, Thailand] gcloud tr-TR [Turkish, Turkey] uk-UA [Ukrainian, Ukraine] gcloud vi-VN [Vietnamese, Vietnam] gcloud |
urls.ring | Available 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
, orno_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
- YAML
- JSON
version: 1.0.0
sections:
main:
- label: welcome
prompt: https://example.com/menu.wav
result:
case:
1:
- transfer: https://example.com/sales.swml
default:
- play: https://example.com/bad_input.wav
- goto: welcome
{
"version": "1.0.0",
"sections": {
"main": [
{
"label": "welcome",
"prompt": {
"urls": ["https://example.com/menu.wav"],
"result": {
"case": {
"1": [{ "transfer": "https://example.com/sales.swml" }]
},
"default": [
{ "play": "https://example.com/bad_input.wav" },
{ "goto": "welcome" }
]
}
}
}
]
}
}
Play prompt and wait for digit or speech
- YAML
- JSON
version: 1.0.0
sections:
main:
- label: welcome
prompt:
play: https://example.com/press_or_say_one.wav
speech_language: en
max_digits: 1
hints:
- one
- two
- three
- four
- five
- six
- seven
- eight
- nine
result:
variable: prompt_value
case:
1:
- transfer: https://example.com/sales.swml
one:
- transfer: https://example.com/sales.swml
default:
- play: https://example.com/bad_input.wav
- goto:
label: welcome
max: 3
{
"version": "1.0.0",
"sections": {
"main": [
{
"label": "welcome",
"prompt": {
"play": "https://example.com/press_or_say_one.wav",
"speech_language": "en",
"max_digits": 1,
"hints": [
"one",
"two",
"three",
"four",
"five",
"six",
"seven",
"eight",
"nine"
],
"result": {
"case": {
"1": [{ "transfer": "https://example.com/sales.swml" }],
"one": [{ "transfer": "https://example.com/sales.swml" }]
},
"default": [
{ "play": "https://example.com/bad_input.wav" },
{ "goto": { "label": "welcome", "max": 3 } }
]
}
}
}
]
}
}
Play prompt and collect digits, then pass the data to an external action
- YAML
- JSON
version: 1.0.0
sections:
main:
- prompt: https://example.com/menu.wav
- transfer: https://example.com/post_next_menu
{
"version": "1.0.0",
"sections": {
"main": [
{ "prompt": "https://example.com/menu.wav" },
{ "transfer": "https://example.com/post_next_menu" }
]
}
}