Tag: 微软认知

如何在Windows Server 2012 R2上运行Microsoft.CognitiveServices.Speech

我需要将语音从wav文件转换为文本。 所以我从Quickstart下载了示例C#代码项目:使用Speech service C#SDK页面识别语音 ,并按照页面上的说明进行操作。 它适用于Windows 10,但我需要该项目在Windows Server 2012 R2上运行,它在Windows Server 2012 R2上不起作用。 当我在Windows Server 2012 R2上运行它时,我按3键进行3.语音识别和文件输入选项。 但是当它尝试执行以下代码时(具有有效的订阅和区域值) var factory = SpeechFactory.FromSubscription(“YourSubscriptionKey”, “YourServiceRegion”); 抛出以下exception: 发生System.TypeInitializationException HResult = 0x80131534 Message =“Microsoft.CognitiveServices.Speech.Internal.carbon_csharpPINVOKE”的类型初始值设定项引发exception。 Source = Microsoft.CognitiveServices.Speech.csharp StackTrace:at Microsoft.CognitiveServices.Speech.Internal.SpeechFactory.FromSubscription(String subscription,String region)中的Microsoft.CognitiveServices.Speech.Internal.carbon_csharpPINVOKE.SpeechFactory_FromSubscription(String jarg1,String jarg2)at at Microsoft.CognitiveServices.Speech.SpeechFactory.FromSubscription(String subscriptionKey,String region)at MicrosoftSpeechSDKSamples.SpeechRecognitionSamples.d__2.MoveNext()in C:\ temp \ csharp_samples \ speech_recognition_samples.cs:line 86 内部exception1:TypeInitializationException:’SWIGExceptionHelper’的类型初始值设定项引发exception。 内部exception2:DllNotFoundException:无法加载DLL’Microsoft.CognitiveServices.Speech.csharp.bindings.dll’:找不到指定的模块。 (HRESULTexception:0x8007007E) 我认为Microsoft.CognitiveServices.Speech.csharp.bindings.dll不喜欢在Windows […]