Partager via


Note

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

PromptBuilder Class

Creates an empty Prompt object and provides methods for adding content, selecting voices, controlling voice attributes, and controlling the pronunciation of spoken words.

Inheritance Hierarchy

System.Object
  Microsoft.Speech.Synthesis.PromptBuilder

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

Syntax

'Declaration
<SerializableAttribute> _
Public NotInheritable Class PromptBuilder
'Usage
Dim instance As PromptBuilder
[SerializableAttribute]
public sealed class PromptBuilder

Remarks

With PromptBuilder, you can add a variety of content types to a prompt, including plain text, SSML markup (as a string or a file), recorded audio, or even another PromptBuilder object.

To append text to a PromptBuilder object and optionally control voice attributes such as emphasis, rate, and volume, use one of the AppendText() methods. You can also control voice attributes as a group with the StartStyle(PromptStyle) and EndStyle() methods.

You can append text and control what is spoken or how it is pronounced using the AppendTextWithHint(), AppendTextWithAlias(String, String), AppendTextWithPronunciation(String, String), AppendSsml(), or AppendSsmlMarkup(String) methods.

Change the currently selected speaking voice in the prompt using one of the overloaded StartVoice() methods, naming a specific voice to use or specifying required voice characteristics, such as age and gender.

To generate speech from a PromptBuilder object, you can pass it as an argument to the Speak(PromptBuilder) method.

For more information, see Construct a Complex Prompt (Microsoft.Speech)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

PromptBuilder Members

Microsoft.Speech.Synthesis Namespace