PromptBuilder Class

Definition

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

public ref class PromptBuilder
public class PromptBuilder
[System.Serializable]
public class PromptBuilder
type PromptBuilder = class
[<System.Serializable>]
type PromptBuilder = class
Public Class PromptBuilder
Inheritance
PromptBuilder
Attributes

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

Constructors

PromptBuilder()

Creates a new instance of the PromptBuilder class.

PromptBuilder(CultureInfo)

Creates a new instance of the PromptBuilder class and specifies a culture.

Properties

Culture

Gets or sets the culture information for the PromptBuilder object.

IsEmpty

Gets whether the PromptBuilder is empty.

Methods

AppendAudio(String)

Appends the specified audio file to the PromptBuilder.

AppendAudio(Uri)

Appends the audio file at the specified URI to the PromptBuilder.

AppendAudio(Uri, String)

Appends the specified audio file and alternate text to the PromptBuilder.

AppendBookmark(String)

Appends a bookmark to the PromptBuilder object.

AppendBreak()

Appends a break to the PromptBuilder object.

AppendBreak(PromptBreak)

Appends a break to the PromptBuilder object and specifies its strength (duration).

AppendBreak(TimeSpan)

Appends a break of the specified duration to the PromptBuilder object.

AppendPromptBuilder(PromptBuilder)

Appends a PromptBuilder object to another PromptBuilder object.

AppendSsml(String)

Appends the SSML file at the specified path to the PromptBuilder object.

AppendSsml(Uri)

Appends the SSML file at the specified URI to the PromptBuilder object.

AppendSsml(XmlReader)

Appends an XMLReader object that references an SSML prompt to the PromptBuilder object.

AppendSsmlMarkup(String)

Appends the specified string containing SSML markup to the PromptBuilder object.

AppendText(String)

Specifies text to append to the PromptBuilder object.

AppendText(String, PromptEmphasis)

Appends text to the PromptBuilder object and specifies the degree of emphasis for the text.

AppendText(String, PromptRate)

Appends text to the PromptBuilder object and specifies the speaking rate for the text.

AppendText(String, PromptVolume)

Appends text to the PromptBuilder object and specifies the volume to speak the text.

AppendTextWithAlias(String, String)

Appends text to the PromptBuilder object and specifies the alias text to be spoken in place of the appended text.

AppendTextWithHint(String, SayAs)

Appends text to the PromptBuilder object and specifies the content type using a member of the SayAs enumeration.

AppendTextWithHint(String, String)

Appends text to the PromptBuilder object and a String that specifies the content type of the text.

AppendTextWithPronunciation(String, String)

Appends text to the PromptBuilder object and specifies the pronunciation for the text.

ClearContent()

Clears the content from the PromptBuilder object.

EndParagraph()

Specifies the end of a paragraph in the PromptBuilder object.

EndSentence()

Specifies the end of a sentence in the PromptBuilder object.

EndStyle()

Specifies the end of a style in the PromptBuilder object.

EndVoice()

Specifies the end of use of a voice in the PromptBuilder object.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
StartParagraph()

Specifies the start of a paragraph in the PromptBuilder object.

StartParagraph(CultureInfo)

Specifies the start of a paragraph in the specified culture in the PromptBuilder object.

StartSentence()

Specifies the start of a sentence in the PromptBuilder object.

StartSentence(CultureInfo)

Specifies the start of a sentence in the specified culture in the PromptBuilder object.

StartStyle(PromptStyle)

Specifies the start of a style in the PromptBuilder object.

StartVoice(CultureInfo)

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

StartVoice(String)

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

StartVoice(VoiceGender)

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

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(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(VoiceInfo)

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

ToString()

Returns a string that represents the current object.

(Inherited from Object)
ToXml()

Returns the SSML generated from the PromptBuilder object.

Applies to