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
Namespace:
Microsoft.Speech.Synthesis
Assembly:
Microsoft.Speech (in Microsoft.Speech.dll)
Syntax
Visual Basic (Declaration) |
---|
<SerializableAttribute> _ Public NotInheritable Class PromptBuilder |
Visual Basic (Usage) |
---|
Dim instance As PromptBuilder |
C# |
---|
[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)