This documentation is archived and is not being maintained.

TtsEngineSsml Class

Abstract base class to be implemented by all text to speech synthesis engines.


Namespace:  System.Speech.Synthesis.TtsEngine
Assembly:  System.Speech (in System.Speech.dll)

public abstract class TtsEngineSsml

The TtsEngineSsml type exposes the following members.

Protected methodTtsEngineSsmlConstructs a new instance of TtsEngineSsml based on an appropriate Voice Token registry key.

Public methodAddLexiconAdds a lexicon to the SynthesizerVoice implemented by the current TtsEngineSsml instance.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetOutputFormatReturns 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.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRemoveLexiconRemoves a lexicon currently loaded by the SynthesizerVoice implemented by the current TtsEngineSsml instance.
Public methodSpeakRenders specified TextFragment array in the specified output format.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

To construct a custom text to speech engine, an application must always implement a class derived from the abstract base class TtsEngineSsml.

A properly registered implementation of TtsEngineSsml can then be used as a SynthesizerVoice by System.Speech.Synthesis name space based applications.

Objects inheriting from TtsEngineSsml must override the following members: TtsEngineSsml, AddLexicon, RemoveLexicon, [M:System.Speech.Synthesis.TtsEngine.TtsEngineSsml.GetOutputFormat(System.Speech.Synthesis.TtsEngine.SpeakOutputFormat,System.IntPtr),] and Speak.

The most important member of the TtsEngineSsml class to be implemented is the Speak method.

The Speak method is called by the infrastructures text parser receiving:

  1. A reference to the ITtsEngineSite interface, which provides access to system services such as even queuing and writing audio output.

  2. An array of TextFragment instance produced from Speech Synthesis Markup Language (SSML) input. 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 T[:System.Speech.Synthesis.TtsEngine.FragmentState] instance associated with each incoming TextFragment object.

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.

An implementer can also provide support for managing external definitions of pronunciations, or lexicons, by their implementation of AddLexicon and RemoveLexicon.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.