-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
ns-System.Speech.Synthesis.xml
50 lines (33 loc) · 6.09 KB
/
ns-System.Speech.Synthesis.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<Namespace Name="System.Speech.Synthesis">
<Docs>
<summary>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.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
**Initialize and Configure**
The <xref:System.Speech.Synthesis.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 <xref:System.Speech.Synthesis.SpeechSynthesizer> instance initializes to the default voice. To configure a <xref:System.Speech.Synthesis.SpeechSynthesizer> instance to use one of the other installed voices, call the <xref:System.Speech.Synthesis.SpeechSynthesizer.SelectVoice%2A> or <xref:System.Speech.Synthesis.SpeechSynthesizer.SelectVoiceByHints%2A> methods. To get information about which voices are installed, use the <xref:System.Speech.Synthesis.SpeechSynthesizer.GetInstalledVoices%2A> method.
You can route the output of the <xref:System.Speech.Synthesis.SpeechSynthesizer> to a stream, a file, the default audio device, or to a null device by using one of the methods in the <xref:System.Speech.Synthesis.SpeechSynthesizer> class whose name begins with "`SetOutputTo`".
**Create Prompts**
Use one the methods of the <xref:System.Speech.Synthesis.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](https://learn.microsoft.com/previous-versions/office/developer/speech-technologies/hh361616(v%3doffice.14)) in the [System Speech Programming Guide for .NET Framework](https://learn.microsoft.com/previous-versions/office/developer/speech-technologies/hh361625(v%3doffice.14)) for more information and examples.
**Generate Speech**
To generate speech from a string or from a <xref:System.Speech.Synthesis.Prompt> or <xref:System.Speech.Synthesis.PromptBuilder> object, use the <xref:System.Speech.Synthesis.SpeechSynthesizer.Speak%2A> or the <xref:System.Speech.Synthesis.SpeechSynthesizer.SpeakAsync%2A> methods. To generate speech from SSML markup, use the <xref:System.Speech.Synthesis.SpeechSynthesizer.SpeakSsml%2A> or the <xref:System.Speech.Synthesis.SpeechSynthesizer.SpeakSsmlAsync%2A> methods. See [Speech Synthesis Markup Language Reference](/previous-versions/ff394847(v=msdn.10)) for a guide to SSML markup.
You can guide the pronunciation of words by using the <xref:System.Speech.Synthesis.PromptBuilder.AppendTextWithHint%2A> or <xref:System.Speech.Synthesis.PromptBuilder.AppendTextWithPronunciation%2A> methods, and by adding or removing lexicons for a <xref:System.Speech.Synthesis.SpeechSynthesizer> instance using the <xref:System.Speech.Synthesis.SpeechSynthesizer.AddLexicon%2A> and <xref:System.Speech.Synthesis.SpeechSynthesizer.RemoveLexicon%2A> methods.
**Respond to Events**
The <xref:System.Speech.Synthesis.SpeechSynthesizer> class includes events that inform a speech application that the <xref:System.Speech.Synthesis.SpeechSynthesizer> encountered a specific feature in a prompt, as reported by the <xref:System.Speech.Synthesis.SpeakProgressEventArgs>, <xref:System.Speech.Synthesis.BookmarkReachedEventArgs>, <xref:System.Speech.Synthesis.PhonemeReachedEventArgs>, and <xref:System.Speech.Synthesis.VisemeReachedEventArgs> classes.
To get information about the beginning and end of the speaking of a prompt by the <xref:System.Speech.Synthesis.SpeechSynthesizer>, use the <xref:System.Speech.Synthesis.SpeakStartedEventArgs> and <xref:System.Speech.Synthesis.SpeakCompletedEventArgs> classes.
See [Using Speech Synthesis Events](https://learn.microsoft.com/previous-versions/office/developer/speech-technologies/hh361577(v%3doffice.14)) in the [System Speech Programming Guide for .NET Framework](https://learn.microsoft.com/previous-versions/office/developer/speech-technologies/hh361625(v%3doffice.14)) for more information and examples.
**Modify Voice Characteristics**
The <xref:System.Speech.Synthesis.PromptStyle> class and <xref:System.Speech.Synthesis.PromptBuilder.StartStyle%2A> and <xref:System.Speech.Synthesis.PromptBuilder.AppendText%2A> methods let you modify characteristics of a <xref:System.Speech.Synthesis.SpeechSynthesizer> voice using <xref:System.Speech.Synthesis.PromptStyle.Emphasis%2A>, <xref:System.Speech.Synthesis.PromptStyle.Rate%2A>, and <xref:System.Speech.Synthesis.PromptStyle.Volume%2A> parameters. To modify characteristics of a voice such as culture, age, and gender, use one of the <xref:System.Speech.Synthesis.PromptBuilder.StartVoice%2A> methods of the <xref:System.Speech.Synthesis.PromptBuilder> class or the <xref:System.Speech.Synthesis.SpeechSynthesizer.SelectVoiceByHints%2A> methods of the <xref:System.Speech.Synthesis.SpeechSynthesizer> class.
See [Controlling Voice Attributes](https://learn.microsoft.com/previous-versions/office/developer/speech-technologies/hh362932(v%3doffice.14)) in the [System Speech Programming Guide for .NET Framework](https://learn.microsoft.com/previous-versions/office/developer/speech-technologies/hh361625(v%3doffice.14)) for more information.
]]></format>
</remarks>
<altmember cref="N:System.Speech.AudioFormat" />
<altmember cref="N:System.Speech.Recognition" />
<altmember cref="N:System.Speech.Recognition.SrgsGrammar" />
<altmember cref="N:System.Speech.Synthesis.TtsEngine" />
<related type="Article" href="https://learn.microsoft.com/previous-versions/office/developer/speech-technologies/hh361616(v%3doffice.14)">Constructing a Complex Prompt</related>
<related type="Article" href="https://learn.microsoft.com/previous-versions/office/developer/speech-technologies/hh361577(v%3doffice.14)">Using Speech Synthesis Events</related>
<related type="Article" href="https://learn.microsoft.com/previous-versions/office/developer/speech-technologies/hh362932(v%3doffice.14)">Controlling Voice Attributes</related>
</Docs>
</Namespace>