speech to text java sdk got a "Error code: 1007. Error details: Unsupported audio format."

Tianshi Li 1 Reputation point

here is my code:

AudioConfig audioConfig = AudioConfig.fromWavFileInput("src/main/resources/66800878281_R.wav");
SpeechRecognizer recognizer = new SpeechRecognizer(speechConfig, audioConfig);

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

2 answers

Sort by: Most helpful
  1. romungi-MSFT 43,681 Reputation points Microsoft Employee

    @Tianshi Li Is it possible to add logging to your config so additional details around why the file is unsupported can be printed?
    For your SpeechConfig instance you can add the following to setup logging.

    config.setProperty(PropertyId.Speech_LogFilename, "LogfilePathAndName");  
    0 comments No comments

  2. Jerry 0 Reputation points

    i also have this problem. my audio can play right.

    logs as follow:

    TransportError: connection:0xe6c2bc20, code=2, string=Connection was closed by the remote host. Error code: 1007. Error details: Unsupported audio format.

    0 comments No comments