【发布时间】:2015-11-23 09:27:01
【问题描述】:
我有以下程序:
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); 运行它时
为了让 Hazel 阅读这句话,我得到以下SystemArgumentException:
{"Cannot set voice. No matching voice is installed or the voice was disabled."}
并且所有声音都已启用。 我已经安装了以下东西:
- Microsoft 语音平台 - 运行时(版本 11)
- Microsoft 语音平台 - 软件开发工具包 (SDK)(版本 11)
- 以及打印列表中显示的其他语言。
然后我按照this 指南让我的语言被我的操作系统 (win7x64) 识别。 我怎么只能用安娜?
【问题讨论】:
标签: c# text-to-speech