简体   繁体   中英

How to set language in Twilio Flow

I'm trying to set language based on a user input. For example, 1 would be french and 2 would be english. When the user presses 1, I call a "Set variable" widget which sets the "lang" variable and the "menu_text" with the text in the french language. 在此处输入图片说明

The problem is i'm not sure what to set the "lang" variable to in order to use it in my gather widget afterward.

在此处输入图片说明

I tried to set the value to "French (Canadian)" and "fr-CA", but when arriving to the gather_1 widget, the robot text is clearly read by an English text to speech robot.

How can I specify a language literal in the variable "lang" so I can use it as an input for my gather_1 widget?

You can look at your Studio Execution logs, to see the general format used by the Gather Input on Call Widget, then visit the Twilio Text-to-Speech page to discover the language country syntax and voice syntax to use for that country for the Text to Speech (TTS) output and you can discover similar settings in the Twilio Gather documentation to collect Speech to Text (if you are only using touch-tone, no need to do this). Messaging Voice needs to be set.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM