Bagikan melalui


Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

PromptBuilder.StartVoice Method (String)

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

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

Syntax

'Declaration
Public Sub StartVoice ( _
    name As String _
)
'Usage
Dim instance As PromptBuilder
Dim name As String

instance.StartVoice(name)
public void StartVoice(
    string name
)

Parameters

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(String) call EndVoice().

Examples

To specify a voice, the name parameter must contain the exact and entire contents of the Name property. The following code fragment initializes a PromptBuilder in English and changes the voice to French.

// Change the voice to French in a PromptBuilder.
PromptBuilder builder = new PromptBuilder(
  new System.Globalization.CultureInfo("en-US"));
builder.StartVoice(
  "Microsoft Server Speech Text to Speech Voice (fr-FR, Hortense)");
builder.AppendText("Nous sommes arrivé");
builder.EndVoice();

See Also

Reference

PromptBuilder Class

PromptBuilder Members

StartVoice Overload

Microsoft.Speech.Synthesis Namespace