Windows 10 - System.Speech.Synthesis cannot get Mo

2019-06-05 03:50发布

问题:

In my Windows 10's Language, I have installed 2 version of English Language:

  • US
  • United Kingdom

Therefore, in [Settings] > [Time & language] > [Speech]

Under the section [Text-to-Speech], I can see the following options:

  • Microsoft David Mobile
  • Microsoft George Mobile
  • Microsoft Susan Mobile
  • Microsoft Hazel Mobile
  • Microsoft Zira Mobile
  • Microsoft Mark Mobile

but, in C# WinForm, by using the following code:

using System.Speech.Synthesis;
SpeechSynthesizer ss = new SpeechSynthesizer();
ss.GetInstalledVoices();

I can only get:

  • Microsoft David Desktop
  • Microsoft Hazel Desktop
  • Microsoft Zira Desktop

I missed Susan, George and Mark.

How can I get Susan, George and Mark voice version in C# WinForm?

回答1:

You can only access the Windows 10 Voices from the Windows.Media.SpeechSynthesis Namespace which belongs to the WinRT Framework. So you cant use them in WPF or WinForms.

see: What are the different between "Windows.Media.SpeechSynthesis" and "System.Speech.Synthesis"?