Partager via


ModifyingLanguage (Managed Code Sample)

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The ModifyingLanguage sample illustrates how to modify the default text-to-speech (TTS) language at run time. The sample answers the call and plays a welcome message in English (United States), followed by Spanish (United States), English (United Kingdom), French (Canada), and German (Germany). Finally, the application says "Goodbye" in English (United States) and ends the call.

  • Changing the default TTS engine at run time
  • Using ResourceManager and ResourceBundle to localize the welcome message for each language

Running the Sample

To run the sample

  1. In the Samples\Workflow\ModifyingLanguage\ directory of the Speech Server installation directory, open the sample solution file.

  2. To start debugging, press F5.

  3. In the Voice Response Debugging Window dialog box, click the SIP Phone tab, enter any numbers in the Called Party and Calling Party boxes, and then click Call.

Remarks

This sample requires that the language pack for each language be installed. If a language pack for one of the languages used in this sample is not installed, the application states the name of the missing language pack in English (United States).

You might notice that if you attempt to validate the prompts in the ModifyingLanguage sample, you see that the English (United States) greeting prompt has no prerecorded resource file, which causes prompt validation to produce an error, but does not prevent the sample from running correctly. The sample has been designed to play the greeting prompt using TTS.

This code sample is intended to demonstrate specific Speech Server features. It does not necessarily reflect best practices with respect to security and privacy. You should carefully review any code that you deploy in production for potential security risks and privacy issues.