Azure-Samples / Cognitive-Speech-STT-Windows

Windows SDK for the Microsoft Speech-to-Text API, part of Cognitive Services
https://www.microsoft.com/cognitive-services/en-us/speech-api
Other
112 stars 89 forks source link

Would I be able to use the SpeechClient.dll in web api core #44

Closed lokeshkumarn closed 6 years ago

lokeshkumarn commented 6 years ago

Would I be able to use the SpeechClient.dll in web api core

Why I am asking this is because I am getting EntryPointNotFoundException with C++ module failed to load in web api if I use it.

lokeshkumarn commented 6 years ago

Even in Web API 2 , I am facing the issue [BadImageFormatException: Could not load file or assembly 'SpeechClient' or one of its dependencies. An attempt was made to load a program with an incorrect format.] System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +36 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +21 System.Reflection.Assembly.Load(String assemblyString) +28 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38

zhouwangzw commented 6 years ago

For using with Web API, could you please try C# Service Library? It should work with Web API, but probably not with WebCore. We are currently working on a new version which supports WebCore.

lokeshkumarn commented 6 years ago

Service library not responding wss://xxxxxxxxxxxxxxxxxxxxxxxx.api.cris.ai/speech/recognition/interactive/cognitiveservices/v1 Continously calling the GetAuthorizationTokenAsync -- > FetchToken method in the IAuthorizationProvider

zhouwangzw commented 6 years ago

it seems that the URL you were using points to Custom Speech Service (cris.ai). Which service are you using for speech recognition?

lokeshkumarn commented 6 years ago

Using CRIS.ai for Speech To Text

I am getting this error Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.

lokeshkumarn commented 6 years ago

image

zhouwangzw commented 6 years ago

Custom Speech Service (cris.ai) is a different service than Bing Speech Service. If you have problem when using cris.ai, please contact the Custom Speech Service team.

zhouwangzw commented 6 years ago

@lokeshkumarn I talked to the CRIS team, and you probably need to change the URL for token service, as described here: "When using the Service librady you have to change the URI of the authorization provider in the implementation of IAuthorizationProvider to https://westus.api.cognitive.microsoft.com/sts/v1.0/issueToken."

lokeshkumarn commented 6 years ago

yes it worked after changing the URI

Thanks

zhouwangzw commented 6 years ago

Great to know it works now. I am closing the issue. Please feel free to open a new one if you have issues.