它在本地系统上工作,但在实时服务器上不工作。我收到错误消息:
NullReferenceException: Object reference not set to an instance of an object.]
System.Speech.Internal.ObjectTokens.SAPICategories.DefaultDeviceOut() +79
System.Speech.Internal.Synthesis.VoiceSynthesis..ctor(WeakReference speechSynthesizer) +969
System.Speech.Synthesis.SpeechSynthesizer.get_VoiceSynthesizer() +77
System.Speech.Synthesis.SpeechSynthesizer.SetOutputToNull() +55
System.Speech.Synthesis.SpeechSynthesizer.SetOutputStream(Stream stream, SpeechAudioFormatInfo formatInfo, Boolean headerInfo, Boolean closeStreamOnExit) +16
System.Speech.Synthesis.SpeechSynthesizer.SetOutputToWaveStream(Stream audioDestination)发布于 2021-12-02 12:13:02
确保您的服务器上的Microsoft Speech Platform is correctly installed。
另请参阅Microsoft Speech Platform SDK 11 Requirements and Installation页面底部的此注释。
重要
语音平台运行时11和语音平台SDK 11不包括用于语音识别或语音合成(TTS或文本到语音)的运行时语言。您必须单独安装它们。运行时语言包括语言模型、声学模型以及提供语音引擎以执行特定语言的语音识别或TTS所需的其他数据。语音识别或语音合成有不同的运行时语言。您下载的运行时语言的版本(例如,11.0版)必须与您安装的Speech Platform Runtime的版本匹配。您可以使用this link下载运行时语言。
最后,由于nullref专门出现在DefaultDeviceOut()方法中,因此请确保您的服务器实际上具有某种音频输出功能。
https://stackoverflow.com/questions/60428818
复制相似问题