System.Speech.Synthesis

System.Speech.Synthesis Namespace

 

The N:System.Speech.Synthesis namespace contains classes for initializing and configuring a speech synthesis engine, for creating prompts, for generating speech, for responding to events, and for modifying voice characteristics.

ClassDescription
System_CAPS_pubclassBookmarkReachedEventArgs

Returns data from the BookmarkReached event.

System_CAPS_pubclassFilePrompt

Represents a prompt created from a file.

System_CAPS_pubclassInstalledVoice

Contains information about a speech synthesis voice installed in Windows.

System_CAPS_pubclassPhonemeReachedEventArgs

Returns data from the PhonemeReached event.

System_CAPS_pubclassPrompt

Represents information about what can be rendered, either text or an audio file, by the SpeechSynthesizer.

System_CAPS_pubclassPromptBuilder

Creates an empty Prompt object and provides methods for adding content, selecting voices, controlling voice attributes, and controlling the pronunciation of spoken words.

System_CAPS_pubclassPromptEventArgs

Represents the base class for EventArgs classes in the System.Speech.Synthesis namespace.

System_CAPS_pubclassPromptStyle

Defines a style for speaking prompts that consists of settings for emphasis, rate, and volume.

System_CAPS_pubclassSpeakCompletedEventArgs

Returns notification from the SpeakCompleted event.

System_CAPS_pubclassSpeakProgressEventArgs

Returns data from the SpeakProgress event.

System_CAPS_pubclassSpeakStartedEventArgs

Returns notification from the SpeakStarted event.

System_CAPS_pubclassSpeechSynthesizer

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

System_CAPS_pubclassStateChangedEventArgs

Returns data from the StateChanged event.

System_CAPS_pubclassVisemeReachedEventArgs

Returns data from the VisemeReached event.

System_CAPS_pubclassVoiceChangeEventArgs

Returns data from the VoiceChange event.

System_CAPS_pubclassVoiceInfo

Represents an installed speech synthesis engine.

EnumerationDescription
System_CAPS_pubenumPromptBreak

Enumerates values for intervals of prosodic separation (breaks) between word boundaries.

System_CAPS_pubenumPromptEmphasis

Enumerates values for levels of emphasis in prompts.

System_CAPS_pubenumPromptRate

Enumerates values for the speaking rate of prompts.

System_CAPS_pubenumPromptVolume

Enumerates values for volume levels (loudness) in prompts.

System_CAPS_pubenumSayAs

Enumerates the content types for the speaking of elements such as times, dates, and currency.

System_CAPS_pubenumSynthesisMediaType

Enumerates the types of media files.

System_CAPS_pubenumSynthesisTextFormat

Enumerates the types of text formats that may be used to construct a Prompt object.

System_CAPS_pubenumSynthesizerEmphasis

Enumerates levels of synthesizer emphasis.

System_CAPS_pubenumSynthesizerState

Enumerates values for the state of the SpeechSynthesizer.

System_CAPS_pubenumVoiceAge

Defines the values for the age of a synthesized voice.

System_CAPS_pubenumVoiceGender

Defines the values for the gender of a synthesized voice.

Initialize and Configure

The SpeechSynthesizer class provides access to the functionality of a speech synthesis engine that is installed on the host computer. Installed speech synthesis engines are represented by a voice, for example Microsoft Anna. A SpeechSynthesizer instance initializes to the default voice. To configure a SpeechSynthesizer instance to use one of the other installed voices, call the SelectVoice or SelectVoiceByHints methods. To get information about which voices are installed, use the GetInstalledVoices method.

You can route the output of the SpeechSynthesizer to a stream, a file, the default audio device, or to a null device by using one of the methods in the SpeechSynthesizer class whose name begins with “SetOutputTo”.

Create Prompts

Use one the methods of the PromptBuilder class whose name begins with “Append” to build content for prompts from text, Speech Synthesis Markup Language (SSML), files containing text or SSML markup, or prerecorded audio files.

See Constructing a Complex Prompt in the System Speech Programming Guide for .NET Framework 4.0 for more information and examples.

Generate Speech

To generate speech from a string or from a Prompt or PromptBuilder object, use the Speak or the SpeakAsync methods. To generate speech from SSML markup, use the SpeakSsml or the SpeakSsmlAsync methods. See Speech Synthesis Markup Language Reference for a guide to SSML markup.

You can guide the pronunciation of words by using the AppendTextWithHint or AppendTextWithPronunciation methods, and by adding or removing lexicons for a SpeechSynthesizer instance using the AddLexicon and RemoveLexicon methods.

Respond to Events

The SpeechSynthesizer class includes events that inform a speech application that the SpeechSynthesizer encountered a specific feature in a prompt, as reported by the SpeakProgressEventArgs, BookmarkReachedEventArgs, PhonemeReachedEventArgs, and VisemeReachedEventArgs classes.

To get information about the beginning and end of the speaking of a prompt by the SpeechSynthesizer, use the SpeakStartedEventArgs and SpeakCompletedEventArgs classes.

See Using Speech Synthesis Events in the System Speech Programming Guide for .NET Framework 4.0 for more information and examples.

Modify Voice Characteristics

The PromptStyle class and StartStyle and AppendText methods let you modify characteristics of a SpeechSynthesizer voice using Emphasis, Rate, and Volume parameters. To modify characteristics of a voice such as culture, age, and gender, use one of the StartVoice methods of the PromptBuilder class or the SelectVoiceByHints methods of the SpeechSynthesizer class.

See Controlling Voice Attributes in the System Speech Programming Guide for .NET Framework 4.0 for more information.

System.Speech.AudioFormat
System.Speech.Recognition
System.Speech.Recognition.SrgsGrammar
System.Speech.Synthesis.TtsEngine
Constructing a Complex Prompt
Using Speech Synthesis Events
Controlling Voice Attributes

Return to top
Show:
© 2016 Microsoft