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

Tianshi Li 1 Reputation point
2022-05-06T01:26:41.47+00:00

here is my code:

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

Future
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
    2022-05-06T10:20:46.113+00:00

    @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
    2023-05-04T09:02:50.89+00:00

    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