我有以下程序:语音合成,无法选择安装语音
SpeechSynthesizer synth = new SpeechSynthesizer();
List<InstalledVoice> installedVoices = new List<InstalledVoice>();
foreach (InstalledVoice voice in synth.GetInstalledVoices())
{
installedVoices.Add(voice);
Console.WriteLine(voice.VoiceInfo.Name);
}
synth.SelectVoice(installedVoices[1].VoiceInfo.Name);
synth.Speak("This is in English");
安装的声音的输出是这样的:
Microsoft Anna
Microsoft Server Speech Text to Speech Voice (en-GB, Hazel)
Microsoft Server Speech Text to Speech Voice (fr-CA, Harmonie)
Microsoft Server Speech Text to Speech Voice (nl-NL, Hanna)
当我运行synth.SelectVoice(installedVoices[0].VoiceInfo.Name);
程序它工作没有任何问题。 当synth.SelectVoice(installedVoices[1].VoiceInfo.Name);
运行它得到淡褐色读一句,我得到以下SystemArgumentException
:
{"Cannot set voice. No matching voice is installed or the voice was disabled."}
而且所有的声音都启用。 我已经安装了以下几件事:
- 微软语音平台 - 运行时(第11版)
- 微软语音平台 - 软件开发工具包(SDK)(第11版)
- 而其他语言所看到的打印清单。
而且我也跟着this指导让我的语言我的OS(win7x64)的认可。 我怎么只能使用安娜?