Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将文本转换为文字时出现异常_C#_Windows_Text To Speech - Fatal编程技术网

C# 将文本转换为文字时出现异常

C# 将文本转换为文字时出现异常,c#,windows,text-to-speech,C#,Windows,Text To Speech,我已经使用微软Silvia合成器很多年了,我从来没有遇到过任何问题。今天早上,它停止工作,此错误再次出现: 系统中没有条目或安全性中没有可用条目 这是我使用的代码: SpeechSynthesizer ss = new SpeechSynthesizer(); var voiceList = ss.GetInstalledVoices(); ss.SelectVoice(voiceList[0].VoiceInfo.Name); ss.Volume = 100; ss.Rate = 0;

我已经使用微软Silvia合成器很多年了,我从来没有遇到过任何问题。今天早上,它停止工作,此错误再次出现:

系统中没有条目或安全性中没有可用条目

这是我使用的代码:

SpeechSynthesizer ss = new SpeechSynthesizer();
var voiceList = ss.GetInstalledVoices();
ss.SelectVoice(voiceList[0].VoiceInfo.Name); 
ss.Volume = 100; 
ss.Rate = 0; 
ss.SpeakAsync("123");

奇怪但有效的解决方案:在VisualStudio2019上使用相同的目标框架执行相同的代码,效果非常好

我不知道这是什么,但不是C