Azure-Samples / Cognitive-Speech-STT-ServiceLibrary

Service SDK - C# Samples, documentation for service to service speech to text
22 stars 26 forks source link

"Platform not supported" exception calling from ASP.Net Core. #19

Open simra opened 5 years ago

simra commented 5 years ago

Hi, When I try to call the RecognizeAsync method from an ASP.Net Core service, I'm receiving the following exception. I've tried both the short and long phrase services. I'm using nuget package Microsoft.Bing.Speech 2.0.2.

{  
   "ClassName":"System.PlatformNotSupportedException",
   "Message":"Operation is not supported on this platform.",
   "Data":null,
   "InnerException":null,
   "HelpURL":null,
   "StackTraceString":"   at System.Net.WebSockets.WebSocket.RegisterPrefixes()\r\n   at Microsoft.Bing.Messaging.WebSocketFactory.CreateAsync(Uri uri, IDictionary`2 upgradeHeaders, CookieContainer cookies, CancellationToken token)\r\n   at Microsoft.Bing.Messaging.RxTx.ConnectAsync(IWebSocketFactory webSocketFactory, Uri uri, IDictionary`2 upgradeHeaders, CookieContainer cookies, CancellationToken token)\r\n   at Microsoft.Bing.Messaging.MessagingComponentFactory.CreateAsync(Uri uri, CancellationToken token, IDictionary`2 upgradeHeaders, CookieContainer cookies)\r\n   at Microsoft.Bing.Speech.SpeechClient.AudioConnection.ConnectAsync(IMessagingComponentFactory connectionFactory, IConnectionProperties connectionProperties, Byte[] audioHeaders, RequestMetadata requestMetadata, String clientContext, Func`3 onMessagesReceived)\r\n   at Microsoft.Bing.Speech.SpeechClient.AudioConnection.ConnectAsync(IMessagingComponentFactory connectionFactory, IConnectionProperties connectionProperties, Byte[] audioHeaders, RequestMetadata requestMetadata, String clientContext, Func`3 onMessagesReceived)\r\n   at Microsoft.Bing.Speech.SpeechClient.StreamAsync(RequestMetadata requestMetadata, CancellationToken token)\r\n   at Microsoft.Bing.Speech.SpeechClient.RecognizeAsync(SpeechInput speechInput, CancellationToken token)\r\n   ...",
   "RemoteStackTraceString":null,
   "RemoteStackIndex":0,
   "ExceptionMethod":null,
   "HResult":-2146233031,
   "Source":"System.Net.WebSockets",
   "WatsonBuckets":null
}
zhouwangzw commented 5 years ago

We have published new speech SDK to use the new Speech Service. Please try to migrate to use the new Speech Service..

Thanks,