C#中System.Speech.Synthesis命名空间中的SpeechSynthesizer在发布时出现DefaultDeviceOut()错误

C#中System.Speech.Synthesis命名空间中的SpeechSynthesizer在发布时出现DefaultDeviceOut()错误,c#,client,text-to-speech,C#,Client,Text To Speech,我正在使用c#中System.Speech.Speech命名空间的SpeechSynthesizer为我的web应用程序将文本转换为语音。当我在本地机器上运行应用程序时,我得到了所需的输出。但当应用程序发布时,我无法获得语音输出。异常处的堆栈跟踪出现以下错误: 在System.Speech.Synthesis.SpeechSynthesis.ctor(WeakReference SpeechSynthesis)在System.Speech.Synthesis.SpeechSynthesis.ge

我正在使用c#中System.Speech.Speech命名空间的SpeechSynthesizer为我的web应用程序将文本转换为语音。当我在本地机器上运行应用程序时,我得到了所需的输出。但当应用程序发布时,我无法获得语音输出。异常处的堆栈跟踪出现以下错误:

在System.Speech.Synthesis.SpeechSynthesis.ctor(WeakReference SpeechSynthesis)在System.Speech.Synthesis.SpeechSynthesis.get_VoiceSynthesis()在System.Speech.Synthesis.SpeechSynthesis.SetOutputOnAll()中在Project_test.EchoDialog.text2speech(字符串str)的System.Speech.Synthesis.SpeechSynthesizer.SetOutputStream(Stream Stream,SpeechAudioFormatInfo formatInfo,Boolean headerInfo,Boolean closeStreamOnExit)中

异常的TargetSite提供以下信息:DefaultDeviceOut()

我认为此错误是由于应用程序无法获取音频设备信息造成的。任何人都可以提供一些帮助来解决此错误并在客户端为web应用程序启用音频输出。

您尝试过吗?