这是我的中文 TTS 代码,尽管中文 TTS 引擎安装成功,但说话功能失败
\n\nusing Microsoft.Speech.Synthesis;\nusing System.Globalization;\n\nnamespace TTS3\n{\n class Program\n {\n static void Main(string[] args)\n {\n //CultureInfo=new CultureInfo("zh-CN");\n SpeechSynthesizer synth = new SpeechSynthesizer();\n\n// Output information about all of the installed voices. \n foreach (InstalledVoice voice in synth.GetInstalledVoices(new CultureInfo("zh-CN")))\n {\n synth.SelectVoice(voice.VoiceInfo.Name);\n //Console.WriteLine(synth.Voice.Description);\n synth.SetOutputToWaveFile("C:\\\\Users\\\\surabhi\\\\Desktop\\\\yes.wav");\n synth.Speak("\xe4\xbd\xa0\xe5\xa5\xbd\xe4\xb8\x96\xe7\x95\x8c");\n break;\n}\n Console.WriteLine();\n Console.WriteLine("Press any key to exit...");\n Console.ReadKey();\n }\n }\n}\nRun Code Online (Sandbox Code Playgroud)\n\n代码抛出的异常是
\n\nUnhandled Exception: System.InvalidOperationException: Speak error \'80004005\'. -\n--> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been r\neturned from a call to a COM component.\n at …Run Code Online (Sandbox Code Playgroud)