PromptBuilder 類別

定義

建立空的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
繼承
PromptBuilder
屬性

備註

使用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您可以使用AppendSsml 、、AppendTextWithAlias、或方法AppendSsmlMarkup ,附加文字並控制所說的AppendTextWithPronunciation內容或發音。You 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 類別的新執行個體。Creates a new instance of the PromptBuilder class.

PromptBuilder(CultureInfo)

建立PromptBuilder 類別的新執行個體,並指定文化特性。Creates a new instance of the PromptBuilder class and specifies a culture.

屬性

Culture

取得或設定 PromptBuilder 物件的文化特性資訊。Gets or sets the culture information for the PromptBuilder object.

IsEmpty

取得 PromptBuilder 是否為空的。Gets whether the PromptBuilder is empty.

方法

AppendAudio(String)

將指定的音訊檔附加至 PromptBuilderAppends the specified audio file to the PromptBuilder.

AppendAudio(Uri)

將位於指定 URI 的音訊檔附加至 PromptBuilderAppends the audio file at the specified URI to the PromptBuilder.

AppendAudio(Uri, String)

將指定的音訊檔和替代文字附加至PromptBuilderAppends the specified audio file and alternate text to the PromptBuilder.

AppendBookmark(String)

將書籤附加至 PromptBuilder 物件。Appends a bookmark to the PromptBuilder object.

AppendBreak()

將中斷附加至 PromptBuilder 物件。Appends a break to the PromptBuilder object.

AppendBreak(PromptBreak)

將中斷附加至PromptBuilder物件,並指定其強度 (持續期間)。Appends a break to the PromptBuilder object and specifies its strength (duration).

AppendBreak(TimeSpan)

將指定持續時間的中斷附加至 PromptBuilder 物件。Appends a break of the specified duration to the PromptBuilder object.

AppendPromptBuilder(PromptBuilder)

PromptBuilder物件附加至另一個PromptBuilder物件。Appends a PromptBuilder object to another PromptBuilder object.

AppendSsml(String)

將位於指定路徑的 SSML 檔案附加至 PromptBuilder 物件。Appends the SSML file at the specified path to the PromptBuilder object.

AppendSsml(Uri)

將位於指定 URI 的 SSML 檔案附加至 PromptBuilder 物件。Appends the SSML file at the specified URI to the PromptBuilder object.

AppendSsml(XmlReader)

附加 XMLReader 物件,其參考 PromptBuilder 物件的 SSML 提示。Appends an XMLReader object that references an SSML prompt to the PromptBuilder object.

AppendSsmlMarkup(String)

將包含 SSML 標記的指定字串附加至PromptBuilder物件。Appends the specified string containing SSML markup to the PromptBuilder object.

AppendText(String)

指定要附加至 PromptBuilder 物件的文字。Specifies text to append to the PromptBuilder object.

AppendText(String, PromptEmphasis)

將文字附加至PromptBuilder物件,並指定文字的強調程度。Appends text to the PromptBuilder object and specifies the degree of emphasis for the text.

AppendText(String, PromptRate)

將文字附加至 PromptBuilder 物件,並指定文字的讀出速率。Appends text to the PromptBuilder object and specifies the speaking rate for the text.

AppendText(String, PromptVolume)

將文字附加至 PromptBuilder 物件,並指定文字的讀出音量。Appends text to the PromptBuilder object and specifies the volume to speak the text.

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)

將文字附加至PromptBuilder物件,並使用SayAs列舉的成員來指定內容類型。Appends text to the PromptBuilder object and specifies the content type using a member of the SayAs enumeration.

AppendTextWithHint(String, String)

將文字附加至PromptBuilder物件以及會指定文字的內容類型的StringAppends text to the PromptBuilder object and a String that specifies the content type of the text.

AppendTextWithPronunciation(String, String)

將文字附加至 PromptBuilder 物件,並指定文字的發音。Appends text to the PromptBuilder object and specifies the pronunciation for the text.

ClearContent()

PromptBuilder 物件清除內容。Clears the content from the PromptBuilder object.

EndParagraph()

指定 PromptBuilder 物件中的段落結尾。Specifies the end of a paragraph in the PromptBuilder object.

EndSentence()

指定 PromptBuilder 物件中的句子結尾。Specifies the end of a sentence in the PromptBuilder object.

EndStyle()

指定 PromptBuilder 物件中的樣式結尾。Specifies the end of a style in the PromptBuilder object.

EndVoice()

指定 PromptBuilder 物件中的語音使用結尾。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.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
StartParagraph()

指定 PromptBuilder 物件中的段落開頭。Specifies the start of a paragraph in the PromptBuilder object.

StartParagraph(CultureInfo)

指定 PromptBuilder 物件中指定之文化特性中的段落開頭。Specifies the start of a paragraph in the specified culture in the PromptBuilder object.

StartSentence()

指定 PromptBuilder 物件中的段落開頭。Specifies the start of a sentence in the PromptBuilder object.

StartSentence(CultureInfo)

指定 PromptBuilder 物件中指定之文化特性中的句子開頭。Specifies the start of a sentence in the specified culture in the PromptBuilder object.

StartStyle(PromptStyle)

指定 PromptBuilder 物件中的樣式開頭。Specifies the start of a style in the PromptBuilder object.

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)

指示合成器變更 PromptBuilder 物件中的語音,並指定要使用之語音的名稱。Instructs the synthesizer to change the voice in the PromptBuilder object and specifies the name of the voice to use.

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)

指示合成器變更 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)

指示合成器變更 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)

指示合成器變更 PromptBuilder 物件中的語音,並指定新語音的準則。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.

(繼承來源 Object)
ToXml()

傳回從 PromptBuilder 物件產生的 SSML。Returns the SSML generated from the PromptBuilder object.

適用於