Pierre-Luc Champigny
Pierre-Luc Champigny

Reputation: 1851

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. enter image description here

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

enter image description here

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?

Upvotes: 0

Views: 541

Answers (1)

Alan
Alan

Reputation: 10771

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.

Upvotes: 1

Related Questions