java.lang.UnsatisfiedLinkError trying to run Azure text to speech quickstart

Kyle Kinney 0 Reputation points
2023-06-09T21:00:33.8266667+00:00

I'm trying to get started with the Azure text to speech quickstart here: https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-java. However, no matter what I try, I keep getting this error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.microsoft.cognitiveservices.speech.SpeechConfig.setTempDirectory(Ljava/lang/String;)V
	at com.microsoft.cognitiveservices.speech.SpeechConfig.setTempDirectory(Native Method)
	at com.microsoft.cognitiveservices.speech.SpeechConfig.<clinit>(Unknown Source)
	at SpeechSynthesis.main(SpeechSynthesis.java:13)

I've found several people talking about getting this error when using certain flavors of Linux (e.g. https://learn.microsoft.com/en-us/answers/questions/947777/exception-in-speechconfig-settempdirectory), but I'm using Windows 10. I also found this thread, which doesn't specify an operating system: https://learn.microsoft.com/en-us/answers/questions/660957/text-speech-when-speechconfig-init-got-error, but it has no suggested fix. I am using IntelliJ, though, so I may be seeing the same issue? I have no idea what DLL it's failing to find, or where it's supposed to find it.

How can I fix this problem, or is the SDK just arbitrarily nonfunctional on my machine?

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
2,038 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.