SpeechSynthesizer Class

Microsoft Speech Platform SDK 11

Collapse imageExpand ImageCopy imageCopyHover image

Provides access to the functionality of an installed a speech synthesis engine.

Inheritance Hierarchy

System..::..Object
  Microsoft.Speech.Synthesis..::..SpeechSynthesizer

Namespace:  Microsoft.Speech.Synthesis
Assembly:  Microsoft.Speech (in Microsoft.Speech.dll)

Syntax

Visual Basic (Declaration)
Public NotInheritable Class SpeechSynthesizer _
	Implements IDisposable
Visual Basic (Usage)
Dim instance As SpeechSynthesizer
C#
public sealed class SpeechSynthesizer : IDisposable

Remarks

When you create a new SpeechSynthesizer object, it uses the default system voice. To configure the SpeechSynthesizer to use one of the installed speech synthesis (text-to-speech) voices, use the SelectVoice or SelectVoiceByHints method. To get information about which voices are installed, use the GetInstalledVoices method and the VoiceInfo class.

The SpeechSynthesizer can use one or more lexicons to guide its pronunciation of words. To add or remove lexicons, use the AddLexicon and RemoveLexicon methods.

This class also provides control over the following aspects of speech synthesis:

The SpeechSynthesizer raises events when it encounters certain features in prompts: (BookmarkReached and SpeakProgress). It also raises events that report on the start (SpeakStarted) and end (SpeakCompleted) of speak operations and on the change of the speaking voice (VoiceChange).

NoteNote

Always call Dispose()()()() before you release your last reference to the SpeechSynthesizer. Otherwise, the resources it is using will not be freed until the garbage collector calls the SpeechSynthesizer object's Finalize()()()() method.

Thread Safety

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

See Also