【问题标题】:on deploy, System.Speech.dll object not getting set to an instance of an object部署时,System.Speech.dll 对象未设置为对象的实例
【发布时间】:2020-06-11 04:56:20
【问题描述】:

它在本地系统上工作,但在实时服务器上不工作。我收到错误:

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)

【问题讨论】:

标签: c# asp.net asp.net-mvc-4 microsoft-speech-api microsoft-speech-platform


【解决方案1】:

确保您的服务器上的Microsoft Speech Platform is correctly installed

另请参阅Microsoft Speech Platform SDK 11 Requirements and Installation 页面底部的此注释。

重要

语音平台运行时 11 和语音平台 SDK 11 不包括用于语音识别或语音合成(TTS 或文本到语音)的运行时语言。您必须单独安装它们。运行时语言包括语言模型、声学模型和其他必要的数据,以提供语音引擎以执行特定语言的语音识别或 TTS。语音识别或语音合成有不同的运行时语言。您下载的运行时语言版本(例如版本 11.0)必须与您安装的语音平台运行时的版本相匹配。您可以使用this link 下载运行时语言。

最后,由于 nullref 专门出现在 DefaultDeviceOut() 方法中,请确保您的服务器实际上具有某种音频输出功能。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-10-27
    • 2011-01-22
    • 2011-12-17
    • 2018-09-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多