PromptBuilder PromptBuilder PromptBuilder PromptBuilder Class

定义

创建空的 Prompt 对象,并为添加内容、选择语音、控件语音属性和控件朗读单词的发音提供方法。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
[System.Serializable]
public class PromptBuilder
type PromptBuilder = class
Public Class PromptBuilder
继承
PromptBuilderPromptBuilderPromptBuilderPromptBuilder
属性

注解

利用PromptBuilder, 你可以向提示添加各种内容类型, 包括纯文本、SSML 标记 (作为字符串或文件)、录制的音频, 甚至另一个PromptBuilder对象。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.

若要将文本追加PromptBuilder到对象并根据需要控制语音特性 (例如强调、速率和音量), 请使用AppendText方法之一。To append text to a PromptBuilder object and optionally control voice attributes such as emphasis, rate, and volume, use one of the AppendText methods. 你还可以使用StartStyleEndStyle方法将语音属性控制为组。You can also control voice attributes as a group with the StartStyle and EndStyle methods.

AppendTextWithHint可以使用、 AppendTextWithPronunciation 、、AppendSsmlAppendSsmlMarkup方法追加文本和控制所讲述的内容, 或者如何对其进行说明。 AppendTextWithAliasYou can append text and control what is spoken or how it is pronounced using the AppendTextWithHint, AppendTextWithAlias, AppendTextWithPronunciation, AppendSsml, or AppendSsmlMarkup methods.

使用重载StartVoice方法之一在提示中更改当前所选的语音语音, 命名特定语音以使用或指定所需的语音特征, 例如年龄和性别。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.

若要从PromptBuilder对象生成语音, 可以将其作为参数传递Speak给方法。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.

构造函数

PromptBuilder() PromptBuilder() PromptBuilder() PromptBuilder()

创建 PromptBuilder 类的新实例。Creates a new instance of the PromptBuilder class.

PromptBuilder(CultureInfo) PromptBuilder(CultureInfo) PromptBuilder(CultureInfo) PromptBuilder(CultureInfo)

创建 PromptBuilder 类的新实例并指定区域性。Creates a new instance of the PromptBuilder class and specifies a culture.

属性

Culture Culture Culture Culture

获取或设置 PromptBuilder 对象的区域性信息。Gets or sets the culture information for the PromptBuilder object.

IsEmpty IsEmpty IsEmpty IsEmpty

获取 PromptBuilder 是否是为空。Gets whether the PromptBuilder is empty.

方法

AppendAudio(String) AppendAudio(String) AppendAudio(String) AppendAudio(String)

将指定的音频文件追加到 PromptBuilderAppends the specified audio file to the PromptBuilder.

AppendAudio(Uri) AppendAudio(Uri) AppendAudio(Uri) AppendAudio(Uri)

将指定 URI 中的音频文件追加到 PromptBuilderAppends the audio file at the specified URI to the PromptBuilder.

AppendAudio(Uri, String) AppendAudio(Uri, String) AppendAudio(Uri, String) AppendAudio(Uri, String)

将指定的音频文件和替代文本追加到 PromptBuilderAppends the specified audio file and alternate text to the PromptBuilder.

AppendBookmark(String) AppendBookmark(String) AppendBookmark(String) AppendBookmark(String)

PromptBuilder 对象追加书签。Appends a bookmark to the PromptBuilder object.

AppendBreak() AppendBreak() AppendBreak() AppendBreak()

将中断添加到 PromptBuilder 对象。Appends a break to the PromptBuilder object.

AppendBreak(PromptBreak) AppendBreak(PromptBreak) AppendBreak(PromptBreak) AppendBreak(PromptBreak)

将中断添加到 PromptBuilder 对象,并指定其强度(持续时间)。Appends a break to the PromptBuilder object and specifies its strength (duration).

AppendBreak(TimeSpan) AppendBreak(TimeSpan) AppendBreak(TimeSpan) AppendBreak(TimeSpan)

将指定持续时间的中断追加到 PromptBuilder 对象。Appends a break of the specified duration to the PromptBuilder object.

AppendPromptBuilder(PromptBuilder) AppendPromptBuilder(PromptBuilder) AppendPromptBuilder(PromptBuilder) AppendPromptBuilder(PromptBuilder)

将一个 PromptBuilder 对象追加到另一个 PromptBuilder 对象。Appends a PromptBuilder object to another PromptBuilder object.

AppendSsml(String) AppendSsml(String) AppendSsml(String) AppendSsml(String)

将指定路径中的 SSML 文件追加到 PromptBuilder 对象。Appends the SSML file at the specified path to the PromptBuilder object.

AppendSsml(Uri) AppendSsml(Uri) AppendSsml(Uri) AppendSsml(Uri)

将指定 URL 中的 SSML 文件追加到 PromptBuilder 对象。Appends the SSML file at the specified URI to the PromptBuilder object.

AppendSsml(XmlReader) AppendSsml(XmlReader) AppendSsml(XmlReader) AppendSsml(XmlReader)

追加一个 XMLReader 对象,该对象引用 PromptBuilder 对象的 SSML 提示。Appends an XMLReader object that references an SSML prompt to the PromptBuilder object.

AppendSsmlMarkup(String) AppendSsmlMarkup(String) AppendSsmlMarkup(String) AppendSsmlMarkup(String)

将包含 SSML 标记的指定字符串追加到 PromptBuilder 对象。Appends the specified string containing SSML markup to the PromptBuilder object.

AppendText(String) AppendText(String) AppendText(String) AppendText(String)

指定要追加到 PromptBuilder 对象的文本。Specifies text to append to the PromptBuilder object.

AppendText(String, PromptEmphasis) AppendText(String, PromptEmphasis) AppendText(String, PromptEmphasis) AppendText(String, PromptEmphasis)

将文本追加到 PromptBuilder 对象,并为该文本指定强调程度。Appends text to the PromptBuilder object and specifies the degree of emphasis for the text.

AppendText(String, PromptRate) AppendText(String, PromptRate) AppendText(String, PromptRate) AppendText(String, PromptRate)

将文本追加到 PromptBuilder 对象,并为该文本指定语速。Appends text to the PromptBuilder object and specifies the speaking rate for the text.

AppendText(String, PromptVolume) AppendText(String, PromptVolume) AppendText(String, PromptVolume) AppendText(String, PromptVolume)

将文本追加到 PromptBuilder 对象,并指定朗读该文本的音量。Appends text to the PromptBuilder object and specifies the volume to speak the text.

AppendTextWithAlias(String, String) AppendTextWithAlias(String, String) AppendTextWithAlias(String, String) AppendTextWithAlias(String, String)

将文本追加到 PromptBuilder 对象,并指定在该追加的文本位置处朗读的别名文本。Appends text to the PromptBuilder object and specifies the alias text to be spoken in place of the appended text.

AppendTextWithHint(String, SayAs) AppendTextWithHint(String, SayAs) AppendTextWithHint(String, SayAs) AppendTextWithHint(String, SayAs)

将文本追加到 PromptBuilder 对象,并使用 SayAs 枚举的成员指定内容类型。Appends text to the PromptBuilder object and specifies the content type using a member of the SayAs enumeration.

AppendTextWithHint(String, String) AppendTextWithHint(String, String) AppendTextWithHint(String, String) AppendTextWithHint(String, String)

将文本追加到 PromptBuilder 对象本,String 指定该文本的内容类型。Appends text to the PromptBuilder object and a String that specifies the content type of the text.

AppendTextWithPronunciation(String, String) AppendTextWithPronunciation(String, String) AppendTextWithPronunciation(String, String) AppendTextWithPronunciation(String, String)

PromptBuilder 对象追加文本,并为该文本指定发音。Appends text to the PromptBuilder object and specifies the pronunciation for the text.

ClearContent() ClearContent() ClearContent() ClearContent()

清除 PromptBuilder 对象中的内容。Clears the content from the PromptBuilder object.

EndParagraph() EndParagraph() EndParagraph() EndParagraph()

指定 PromptBuilder 对象的终点段。Specifies the end of a paragraph in the PromptBuilder object.

EndSentence() EndSentence() EndSentence() EndSentence()

指定 PromptBuilder 对象的终点句。Specifies the end of a sentence in the PromptBuilder object.

EndStyle() EndStyle() EndStyle() EndStyle()

指定 PromptBuilder 对象的终点样式。Specifies the end of a style in the PromptBuilder object.

EndVoice() EndVoice() EndVoice() EndVoice()

指定 PromptBuilder 对象的最终使用语音。Specifies the end of use of a voice in the PromptBuilder object.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
StartParagraph() StartParagraph() StartParagraph() StartParagraph()

指定 PromptBuilder 对象的开始段。Specifies the start of a paragraph in the PromptBuilder object.

StartParagraph(CultureInfo) StartParagraph(CultureInfo) StartParagraph(CultureInfo) StartParagraph(CultureInfo)

PromptBuilder 对象的指定区域性指定段的开头。Specifies the start of a paragraph in the specified culture in the PromptBuilder object.

StartSentence() StartSentence() StartSentence() StartSentence()

指定 PromptBuilder 对象的开始句。Specifies the start of a sentence in the PromptBuilder object.

StartSentence(CultureInfo) StartSentence(CultureInfo) StartSentence(CultureInfo) StartSentence(CultureInfo)

PromptBuilder 对象的指定区域性指定句的开头。Specifies the start of a sentence in the specified culture in the PromptBuilder object.

StartStyle(PromptStyle) StartStyle(PromptStyle) StartStyle(PromptStyle) StartStyle(PromptStyle)

指定 PromptBuilder 对象的开始样式。Specifies the start of a style in the PromptBuilder object.

StartVoice(CultureInfo) StartVoice(CultureInfo) StartVoice(CultureInfo) StartVoice(CultureInfo)

指示合成器更改 PromptBuilder 对象中的语音并指定要使用的语音的区域性。Instructs the synthesizer to change the voice in the PromptBuilder object and specifies the culture of the voice to use.

StartVoice(String) StartVoice(String) StartVoice(String) StartVoice(String)

指示合成器更改 PromptBuilder 对象中的语音并指定要使用的语音的名称。Instructs the synthesizer to change the voice in the PromptBuilder object and specifies the name of the voice to use.

StartVoice(VoiceGender) StartVoice(VoiceGender) StartVoice(VoiceGender) StartVoice(VoiceGender)

指示合成器更改 PromptBuilder 对象中的语音并指定要使用的语音的性别。Instructs the synthesizer to change the voice in the PromptBuilder object and specifies the gender of the voice to use.

StartVoice(VoiceGender, VoiceAge) StartVoice(VoiceGender, VoiceAge) StartVoice(VoiceGender, VoiceAge) StartVoice(VoiceGender, VoiceAge)

指示合成器更改 PromptBuilder 对象中的语音并指定新语音的性别和年龄。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) StartVoice(VoiceGender, VoiceAge, Int32) StartVoice(VoiceGender, VoiceAge, Int32) StartVoice(VoiceGender, VoiceAge, Int32)

指示合成器更改 PromptBuilder 对象中的语音并指定其性别、年龄和与指定的性别和年龄匹配的首选语音。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) StartVoice(VoiceInfo) StartVoice(VoiceInfo) StartVoice(VoiceInfo)

指示合成器更改 PromptBuilder 对象中的语音并为新的语音指定条件。Instructs the synthesizer to change the voice in the PromptBuilder object and specifies criteria for the new voice.

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)
ToXml() ToXml() ToXml() ToXml()

返回从 PromptBuilder 对象生成的 SSML。Returns the SSML generated from the PromptBuilder object.

适用于