TtsEngineSsml TtsEngineSsml TtsEngineSsml TtsEngineSsml Class

定義

要由所有文字轉換語音合成引擎實作的抽象基底類別。Abstract base class to be implemented by all text to speech synthesis engines.

public ref class TtsEngineSsml abstract
public abstract class TtsEngineSsml
type TtsEngineSsml = class
Public MustInherit Class TtsEngineSsml
繼承
TtsEngineSsmlTtsEngineSsmlTtsEngineSsmlTtsEngineSsml

備註

若要建立自訂文字轉換語音引擎, 應用程式必須一律執行衍生自抽象基類TtsEngineSsml的類別。To construct a custom text to speech engine, an application must always implement a class derived from the abstract base class TtsEngineSsml.

接著, 適當註冊的TtsEngineSsml實作為以命名空間為基礎的應用System.Speech.Synthesis程式, 可以用來作為合成者語音。A properly registered implementation of TtsEngineSsml can then be used as a synthesizer voice by System.Speech.Synthesis name space based applications.

TtsEngineSsml繼承自的物件必須覆寫下列成員TtsEngineSsml: AddLexiconRemoveLexiconGetOutputFormatSpeakObjects inheriting from TtsEngineSsml must override the following members: TtsEngineSsml, AddLexicon, RemoveLexicon, GetOutputFormat and Speak.

要實作為TtsEngineSsml類別的最重要成員, Speak就是方法。The most important member of the TtsEngineSsml class to be implemented is the Speak method.

Speak方法是由接收的基礎結構文字剖析器所呼叫:The Speak method is called by the infrastructures text parser receiving:

  1. ITtsEngineSite介面的參考, 可讓您存取系統服務, 例如甚至佇列和寫入音訊輸出。A reference to the ITtsEngineSite interface, which provides access to system services such as even queuing and writing audio output.

  2. 從語音合成TextFragment標記語言 (SSML) 輸入產生的實例陣列。An array of TextFragment instance produced from Speech Synthesis Markup Language (SSML) input. 除了要轉譯為語音的文字以外, SSML 的剖析也會在與每個連入FragmentState TextFragment物件相關聯的實例中, 將語音要求的屬性資訊儲存在一起。In addition to text to be rendered as speech, the parsing of the SSML stores information about the requested attributes of the speech in a FragmentState instance associated with each incoming TextFragment object.

語音合成器應用程式可以在嘗試提供正確的音訊輸出時, GetOutputFormat藉由執行來呼叫指定的輸出格式, 以選擇性地提出要求。A speech synthesizer application can optionally make requests for a specified output format by implementing GetOutputFormat to be called by the platform when it tries to provide the correct audio output.

實施者也可以透過其執行AddLexiconRemoveLexicon, 提供管理發音或字典外部定義的支援。An implementer can also provide support for managing external definitions of pronunciations, or lexicons, by their implementation of AddLexicon and RemoveLexicon.

建構函式

TtsEngineSsml(String) TtsEngineSsml(String) TtsEngineSsml(String) TtsEngineSsml(String)

根據適當的語音語彙基元登錄機碼來建構TtsEngineSsml的新執行個體。Constructs a new instance of TtsEngineSsml based on an appropriate Voice Token registry key.

方法

AddLexicon(Uri, String, ITtsEngineSite) AddLexicon(Uri, String, ITtsEngineSite) AddLexicon(Uri, String, ITtsEngineSite) AddLexicon(Uri, String, ITtsEngineSite)

將語彙加入至目前的 TtsEngineSsml 執行個體所實作的 SynthesizerVoiceAdds a lexicon to the SynthesizerVoice implemented by the current TtsEngineSsml instance.

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)
GetOutputFormat(SpeakOutputFormat, IntPtr) GetOutputFormat(SpeakOutputFormat, IntPtr) GetOutputFormat(SpeakOutputFormat, IntPtr) GetOutputFormat(SpeakOutputFormat, IntPtr)

傳回指定的合成引擎所支援的最符合音訊輸出,以回應合成器引擎支援特定輸出格式的要求。Returns the best matching audio output supported by a given synthesize engine response to a request to the synthesizer engine for the support of a particular output format.

GetType() GetType() GetType() GetType()

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

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

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

(Inherited from Object)
RemoveLexicon(Uri, ITtsEngineSite) RemoveLexicon(Uri, ITtsEngineSite) RemoveLexicon(Uri, ITtsEngineSite) RemoveLexicon(Uri, ITtsEngineSite)

將目前 TtsEngineSsml 執行個體所實作的 SynthesizerVoice 目前載入的語彙移除。Removes a lexicon currently loaded by the SynthesizerVoice implemented by the current TtsEngineSsml instance.

Speak(TextFragment[], IntPtr, ITtsEngineSite) Speak(TextFragment[], IntPtr, ITtsEngineSite) Speak(TextFragment[], IntPtr, ITtsEngineSite) Speak(TextFragment[], IntPtr, ITtsEngineSite)

以指定的輸出格式來呈現指定的 TextFragment 陣列。Renders specified TextFragment array in the specified output format.

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

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

適用於