Azure-Samples / cognitive-services-speech-sdk

Sample code for the Microsoft Cognitive Services Speech SDK
MIT License
2.82k stars 1.83k forks source link

Keep getting UnsatisfiedLinkError and not sure why #469

Closed Flippeh closed 4 years ago

lisaweixu commented 4 years ago

Hello Flippeh,

I followed the java quickstart and I could not reproduce the UnSatisfiedLinkeError that you saw.

The Speech SDK implicitly loads at least two native dlls, Microsoft.CognitiveServices.Speech.core.dll and Microsoft.CognitiveServices.Speech.java.bindings.dll. My guess is that the UnsatisfiedLinkError is due to JVM can't find them, for some reason. More details, https://examples.javacodegeeks.com/java-basics/exceptions/java-lang-unsatisfiedlinkerror-how-to-handle-unsatisfied-link-error/

Here is my pom.xml `

4.0.0 com.microsoft.cognitiveservices.speech.samples 2020Xmas 0.0.1-SNAPSHOT src maven-compiler-plugin 3.7.0 1.8 1.8 maven-cognitiveservices-speech Microsoft Cognitive Services Speech Maven Repository https://csspeechstorage.blob.core.windows.net/maven/ com.microsoft.cognitiveservices.speech client-sdk 1.8.0

` BTW, I could have my speech from a microphone correctly recognized.

Flippeh commented 4 years ago

Microsoft.CognitiveServices.Speech.java.bindings.dll

I checked my pom.xml and it is the same as yours and yet I'm still getting this error.

Could it be an issue with the key I'm using? I'm not super sure how this works.

lisaweixu commented 4 years ago

No, It should not be your key since JVM can't find the native dll. The java code is just a wrapper. Verifying key is happening in the native code.

One workaround that I can think of is that you can put C:\Users\Kiffer.m2\repository\com\microsoft\cognitiveservices\speech\client-sdk\1.8.0\client-sdk-1.8.0\ASSETS\windows64 into your PATH.

pankopon commented 4 years ago

Closing the issue because no update since December, please re-open if still valid.