Compartilhar via


PromptBuilder.StartVoice Method

Definition

Instructs the synthesizer to change the voice in a PromptBuilder object.

Overloads

StartVoice(VoiceGender, VoiceAge)

Instructs the synthesizer to change the voice in the PromptBuilder object and specifies the gender and the age of the new voice.

StartVoice(String)

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

StartVoice(VoiceGender, VoiceAge, Int32)

Instructs the synthesizer to change the voice in the PromptBuilder object and specifies its gender, age, and a preferred voice that matches the specified gender and age.

StartVoice(VoiceGender)

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

StartVoice(CultureInfo)

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

StartVoice(VoiceInfo)

Instructs the synthesizer to change the voice in the PromptBuilder object and specifies criteria for the new voice.

Remarks

A voice represents an installed TTS engine. Use the GetInstalledVoices methods and VoiceInfo class to obtain the names and attributes of installed text-to-speech (TTS) voices that you can select.

When an application calls GetInstalledVoices, the method verifies that each of the voices it finds in the registry meets certain minimum criteria. For any voice that fails verification, GetInstalledVoices sets its Enabled property to False. An application cannot call any of the StartVoice methods on a voice whose Enabled property is False. Typically, applications will not set a voice's Enabled property.

StartVoice(VoiceGender, VoiceAge)

Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs

Instructs the synthesizer to change the voice in the PromptBuilder object and specifies the gender and the age of the new voice.

public:
 void StartVoice(System::Speech::Synthesis::VoiceGender gender, System::Speech::Synthesis::VoiceAge age);
public void StartVoice (System.Speech.Synthesis.VoiceGender gender, System.Speech.Synthesis.VoiceAge age);
member this.StartVoice : System.Speech.Synthesis.VoiceGender * System.Speech.Synthesis.VoiceAge -> unit
Public Sub StartVoice (gender As VoiceGender, age As VoiceAge)

Parameters

gender
VoiceGender

The gender of the new voice to use.

age
VoiceAge

The age of the voice to use.

Remarks

Use the GetInstalledVoices methods and VoiceInfo class to obtain the names and attributes of installed text-to-speech (TTS) voices that you can select.

To stop using the voice specified by StartVoice call EndVoice.

Applies to

StartVoice(String)

Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs

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

public:
 void StartVoice(System::String ^ name);
public void StartVoice (string name);
member this.StartVoice : string -> unit
Public Sub StartVoice (name As String)

Parameters

name
String

The name of the voice to use.

Remarks

To get information about which voices are installed, use one of the GetInstalledVoices methods.

To stop using the voice specified by StartVoice call EndVoice.

Applies to

StartVoice(VoiceGender, VoiceAge, Int32)

Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs

Instructs the synthesizer to change the voice in the PromptBuilder object and specifies its gender, age, and a preferred voice that matches the specified gender and age.

public:
 void StartVoice(System::Speech::Synthesis::VoiceGender gender, System::Speech::Synthesis::VoiceAge age, int voiceAlternate);
public void StartVoice (System.Speech.Synthesis.VoiceGender gender, System.Speech.Synthesis.VoiceAge age, int voiceAlternate);
member this.StartVoice : System.Speech.Synthesis.VoiceGender * System.Speech.Synthesis.VoiceAge * int -> unit
Public Sub StartVoice (gender As VoiceGender, age As VoiceAge, voiceAlternate As Integer)

Parameters

gender
VoiceGender

The gender of the voice to use.

age
VoiceAge

The age of the voice to use.

voiceAlternate
Int32

An integer that specifies a preferred voice when more than one voice matches the gender and age parameters.

Remarks

A speech synthesis engine counts the matches it finds for the specified parameters, and returns the voice when the count equals the voiceAlternate parameter.

Use the GetInstalledVoices methods and VoiceInfo class to obtain the names and attributes of installed text-to-speech (TTS) voices that you can select.

To stop using the voice specified by StartVoice call EndVoice.

See also

Applies to

StartVoice(VoiceGender)

Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs

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

public:
 void StartVoice(System::Speech::Synthesis::VoiceGender gender);
public void StartVoice (System.Speech.Synthesis.VoiceGender gender);
member this.StartVoice : System.Speech.Synthesis.VoiceGender -> unit
Public Sub StartVoice (gender As VoiceGender)

Parameters

gender
VoiceGender

The gender of the voice to use.

Remarks

Use the GetInstalledVoices methods and VoiceInfo class to obtain the names and attributes of installed text-to-speech (TTS) voices that you can select.

To stop using the voice specified by StartVoice call EndVoice.

Applies to

StartVoice(CultureInfo)

Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs

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

public:
 void StartVoice(System::Globalization::CultureInfo ^ culture);
public void StartVoice (System.Globalization.CultureInfo culture);
member this.StartVoice : System.Globalization.CultureInfo -> unit
Public Sub StartVoice (culture As CultureInfo)

Parameters

culture
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.

Remarks

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.

Applies to

StartVoice(VoiceInfo)

Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs

Instructs the synthesizer to change the voice in the PromptBuilder object and specifies criteria for the new voice.

public:
 void StartVoice(System::Speech::Synthesis::VoiceInfo ^ voice);
public void StartVoice (System.Speech.Synthesis.VoiceInfo voice);
member this.StartVoice : System.Speech.Synthesis.VoiceInfo -> unit
Public Sub StartVoice (voice As VoiceInfo)

Parameters

voice
VoiceInfo

The criteria for the voice to use.

Remarks

Use the GetInstalledVoices methods and VoiceInfo class to obtain the names and attributes of installed text-to-speech (TTS) voices that you can select.

To stop using the voice specified by StartVoice call EndVoice.

Applies to