【发布时间】:2018-04-02 16:25:48
【问题描述】:
我正在使用这个命令来列出可用的声音
private static SpeechSynthesizer sprecher;
...
sprecher = new SpeechSynthesizer();
...
private static List<VoiceInfo> GetInstalledVoices()
{
var listOfVoiceInfo = from voice
in sprecher.GetInstalledVoices()
select voice.VoiceInfo;
return listOfVoiceInfo.ToList<VoiceInfo>();
}
我只有 4 种不同的声音(Hedda、Hazel、David 和 Zira),但 windows 本身显示了更多的扬声器。
因此我只得到“-Desktop”-声音。如何通过 c# 访问其他扬声器?
【问题讨论】:
-
我删除了我的答案,因为我无法让它在本地工作,我尝试做这里提到的注册表副本:social.msdn.microsoft.com/Forums/en-US/…
-
@hellyale 你说对了。使用这个注册表副本我解决了它。也许你需要像我一样导出它?将
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech_OneCore\Voices的整个Token目录导出到文件中。将文件中的每个HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech_OneCore\Voices\Tokens替换为HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens并运行文件(我删除了我之前已经拥有的声音)。将 CPU 更改为x64。享受吧。 -
好的,我将取消删除并添加这些详细信息。
标签: c# windows-10 speechsynthesizer