我有一个应用程序使用 Microsoft.Speech 来识别 WAV 文件中的语音。它在作为控制台应用程序在本地运行时完美运行,但在由 IIS 执行时会出错。
假设我在带有 .NET 3.5+ 的 WinServer 2008 上安装了以下内容:
- Microsoft 语音平台 - 软件开发工具包 (SDK)(版本 10.1)
- Microsoft 语音平台 - 服务器运行时语言(版本 10.1)
- Microsoft 语音平台 - 软件开发工具包 (SDK)(版本 10.1)
甚至可以在 IIS7 上使用 Microsoft.Speech 吗?我在这里想念什么?
我尝试将其重新编码为 ASP.NET Web 服务,但这也不起作用。
Suuuuper 卡在这里。谢谢,如果你能帮忙 :) 漂亮请 :)
更新: 这是错误消息+堆栈跟踪:
System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) at Microsoft.Speech.Internal.SapiInterop.ISpRecognizer.CreateRecoContext(ISpRecoContext& ppNewCtxt)
at Microsoft.Speech.Internal.SapiInterop.SapiRecognizer.<>c__DisplayClass17.b__16()
at Microsoft.Speech.Internal.SapiInterop.SapiProxy.PassThrough.Invoke(ObjectDelegate pfn)
at Microsoft.Speech.Internal.SapiInterop.SapiRecognizer.CreateRecoContext()
at Microsoft.Speech.Recognition.RecognizerBase.Initialize(SapiRecognizer recognizer, Boolean inproc)
at Microsoft.Speech.Recognition.SpeechRecognitionEngine.get_RecoBase()
at Microsoft.Speech.Recognition.SpeechRecognitionEngine.Initialize(RecognizerInfo recognizerInfo)
at Microsoft.Speech.Recognition.SpeechRecognitionEngine..ctor()
at myRecognize.Recognize..cctor() The type initializer for 'myRecognize.Recognize' threw an exception. myRecognize
at myRecognize.Recognize.get_Reco()
at myRecognize.Recognize.Listen(String wavLoc, String grammars)