Text Speech when SpeechConfig init got error

wwy 16 Reputation points
2021-12-13T06:19:26.993+00:00

I follow the quickstart then here is my code
SpeechConfig speechConfig = SpeechConfig.fromSubscription("XXX", "eastasia");

but when debug, I got errors as follows:
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>(SpeechConfig.java:77)

and then I download the demo code on github and run and get the same error.

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

2 answers

Sort by: Most helpful
  1. wwy 16 Reputation points
    2021-12-14T01:28:22.337+00:00

    the sample link is https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/quickstart/java/jre/text-to-speech
    and the speech sdk info is :
    <dependencies>
    <dependency>
    <groupId>com.microsoft.cognitiveservices.speech</groupId>
    <artifactId>client-sdk</artifactId>
    <version>1.19.0</version>
    </dependency>
    </dependencies>


  2. Ramr-msft 17,736 Reputation points
    2021-12-14T06:15:32.377+00:00

    @wwy Thanks for the details. We can execute successfully without any issue the sample that you are trying as shown in the below snapshot.
    157457-image.png

    Are you facing the same issue with other location/region?
    Here is link to create Speech Config.

    0 comments No comments

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.