Microsoft Cognitive Service Speech-to-Text - Using compressed input audio data "incompatible types"

Henning Weise 21 Reputation points
2022-09-21T11:01:31.66+00:00

I followed the example on 1 to implement STT with Java. When I just copy the code into my Spring Boot Backend, I get the following error:

java: incompatible types: com.microsoft.cognitiveservices.speech.audio.AudioStreamFormat cannot be converted to com.microsoft.cognitiveservices.speech.audio.PullAudioInputStreamCallback

What am I doing wrong here? I just copied the code from the Microsoft page

243426-unbenannt.png

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
2,061 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,602 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ramr-msft 17,826 Reputation points
    2022-09-22T10:56:49.727+00:00

    @Henning Weise Thanks for the question. Are you using which version of SDK? PullAudioInputStream now send wav header information to the Speech Service based on AudioStreamFormat, optionally specified when they were created. now use the supported audio input format. Any other formats will get sub-optimal recognition results or may cause other issues.

    Here is the document to use audio input streams.

    https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/java/jre/console/src/com/microsoft/cognitiveservices/speech/samples/console/WavStream.java

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.