PromptBuilder.AppendTextWithAlias(String, String) 方法
定义
将文本追加到 PromptBuilder 对象,并指定在该追加的文本位置处朗读的别名文本。Appends text to the PromptBuilder object and specifies the alias text to be spoken in place of the appended text.
public:
void AppendTextWithAlias(System::String ^ textToSpeak, System::String ^ substitute);
public void AppendTextWithAlias (string textToSpeak, string substitute);
member this.AppendTextWithAlias : string * string -> unit
Public Sub AppendTextWithAlias (textToSpeak As String, substitute As String)
参数
- textToSpeak
- String
包含文本表示形式的字符串。A string containing the text representation.
- substitute
- String
包含要发言文本的字符串。A string containing the text to be spoken.
示例
下面的示例将一个文本字符串 ( "Speech 合成标记语言" ) 及其别名 ( "SSML" ) 添加到 PromptBuilder 对象。The following example appends a text string ("Speech Synthesis Markup Language") and its alias ("SSML") to a PromptBuilder object. 合成器将按 "S S M L"。The synthesizer will pronounce "S S M L".
PromptBuilder alias = new PromptBuilder();
alias.AppendTextWithAlias("Speech Synthesis Markup Language","SSML");
注解
这允许文档同时包含口述和书面形式的提示。This allows a document to contain both a spoken and a written form for a prompt. 例如,编写的窗体可能是一个缩写词,如 SAPI,口述的窗体可能是首字母缩写词(在此例中为语音应用程序编程接口)的扩展文本。For example, the written form could be an acronym, such as SAPI, and the spoken form could be the expanded text for the acronym, in this case Speech Application Programming Interface.