PromptBuilder.StartVoice Method (CultureInfo)

 

Instructs the synthesizer to change the voice in the PromptBuilder object and specifies the culture of the voice to use.

Namespace:   System.Speech.Synthesis
Assembly:  System.Speech (in System.Speech.dll)

public void StartVoice(
	CultureInfo culture
)

Parameters

culture
Type: System.Globalization.CultureInfo

Provides information about a specific culture, such as the language, the name of the culture, the writing system, the calendar used, and how to format dates and sort strings.

The culture parameter for StartVoice can be different than the Culture property of the PromptBuilder object that contains it. While in effect, the value of the culture parameter will override the Culture property. The SpeechSynthesizer will attempt to select an installed voice that supports the language specified by the culture parameter to speak the content enclosed by StartVoice and EndVoice. If a voice with the specified culture is found, it will be used. If a voice with the specified culture cannot be found, the default voice will be used. To stop using the voice specified by StartVoice, call EndVoice.

To correctly pronounce words in the language specified by the culture parameter, a speech synthesis (text-to-speech or TTS) engine that supports the language must be installed. An installed TTS engine is called a voice. To get information about which voices are installed for a specific culture, use the GetInstalledVoices method.

Microsoft Windows and the System.Speech API accept all valid language-country codes as values for culture. The TTS engines that shipped with Windows 7 support the following language-country codes:

  • en-US. English (United States)

  • zh-CN. Chinese (China)

  • zh-TW. Chinese (Taiwan)

Two-letter language codes such as "en" are also permitted.

.NET Framework
Available since 3.0
Return to top
Show: