Export (0) Print
Expand All

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.

System.Object
  System.Speech.Synthesis.PromptBuilder

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

[SerializableAttribute]
public class PromptBuilder

The PromptBuilder type exposes the following members.

  NameDescription
Public methodPromptBuilder()Creates a new instance of the PromptBuilder class.
Public methodPromptBuilder(CultureInfo)Creates a new instance of the PromptBuilder class and specifies a culture.
Top

  NameDescription
Public propertyCultureGets or sets the culture information for the PromptBuilder object.
Public propertyIsEmptyGets whether the PromptBuilder is empty.
Top

  NameDescription
Public methodAppendAudio(String)Appends the specified audio file to the PromptBuilder.
Public methodAppendAudio(Uri)Appends the audio file at the specified URI to the PromptBuilder.
Public methodAppendAudio(Uri, String)Appends the specified audio file and alternate text to the PromptBuilder.
Public methodAppendBookmarkAppends a bookmark to the PromptBuilder object.
Public methodAppendBreak()Appends a break to the PromptBuilder object.
Public methodAppendBreak(PromptBreak)Appends a break to the PromptBuilder object and specifies its strength (duration).
Public methodAppendBreak(TimeSpan)Appends a break of the specified duration to the PromptBuilder object.
Public methodAppendPromptBuilderAppends a PromptBuilder object to another PromptBuilder object.
Public methodAppendSsml(String)Appends the SSML file at the specified path to the PromptBuilder object.
Public methodAppendSsml(Uri)Appends the SSML file at the specified URI to the PromptBuilder object.
Public methodAppendSsml(XmlReader)Appends an XMLReader object that references an SSML prompt to the PromptBuilder object.
Public methodAppendSsmlMarkupAppends the specified string containing SSML markup to the PromptBuilder object.
Public methodAppendText(String)Specifies text to append to the PromptBuilder object.
Public methodAppendText(String, PromptEmphasis)Appends text to the PromptBuilder object and specifies the degree of emphasis for the text.
Public methodAppendText(String, PromptRate)Appends text to the PromptBuilder object and specifies the speaking rate for the text.
Public methodAppendText(String, PromptVolume)Appends text to the PromptBuilder object and specifies the volume to speak the text.
Public methodAppendTextWithAliasAppends text to the PromptBuilder object and specifies the alias text to be spoken in place of the appended text.
Public methodAppendTextWithHint(String, SayAs)Appends text to the PromptBuilder object and specifies the content type using a member of the SayAs enumeration.
Public methodAppendTextWithHint(String, String)Appends text to the PromptBuilder object and a String that specifies the content type of the text.
Public methodAppendTextWithPronunciationAppends text to the PromptBuilder object and specifies the pronunciation for the text.
Public methodClearContentClears the content from the PromptBuilder object.
Public methodEndParagraphSpecifies the end of a paragraph in the PromptBuilder object.
Public methodEndSentenceSpecifies the end of a sentence in the PromptBuilder object.
Public methodEndStyleSpecifies the end of a style in the PromptBuilder object.
Public methodEndVoiceSpecifies the end of use of a voice in the PromptBuilder object.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodStartParagraph()Specifies the start of a paragraph in the PromptBuilder object.
Public methodStartParagraph(CultureInfo)Specifies the start of a paragraph in the specified culture in the PromptBuilder object.
Public methodStartSentence()Specifies the start of a sentence in the PromptBuilder object.
Public methodStartSentence(CultureInfo)Specifies the start of a sentence in the specified culture in the PromptBuilder object.
Public methodStartStyleSpecifies the start of a style in the PromptBuilder object.
Public methodStartVoice(CultureInfo)Instructs the synthesizer to change the voice in the PromptBuilder object and specifies the culture of the voice to use.
Public methodStartVoice(String)Instructs the synthesizer to change the voice in the PromptBuilder object and specifies the name of the voice to use.
Public methodStartVoice(VoiceGender)Instructs the synthesizer to change the voice in the PromptBuilder object and specifies the gender of the voice to use.
Public methodStartVoice(VoiceInfo)Instructs the synthesizer to change the voice in the PromptBuilder object and specifies criteria for the new voice.
Public methodStartVoice(VoiceGender, VoiceAge)Instructs the synthesizer to change the voice in the PromptBuilder object and specifies the gender and the age of the new voice.
Public methodStartVoice(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.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodToXmlReturns the SSML generated from the PromptBuilder object.
Top

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 and EndStyle methods.

You can append text and control what is spoken or how it is pronounced using the AppendTextWithHint, AppendTextWithAlias, AppendTextWithPronunciation, AppendSsml, or AppendSsmlMarkup 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 method.

For more information, see Constructing a Complex Prompt.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

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