Android AudioConfig.fromWavFileInput : Cannot read properties of undefined (reading 'slice')

abdou abdou 1 Reputation point

Any one can help me please with this issue ?

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

1 answer

Sort by: Most helpful
  1. Ramr-msft 17,611 Reputation points

    @abdou abdou Thanks for the question. Here is Speech to text samples in the github repo and quickstart.
    To recognize speech from an audio file, create an AudioConfig instance by using fromWavFileInput(), which accepts a Buffer object. Then initialize SpeechRecognizer by passing audioConfig and speechConfig.
    let audioConfig = sdk.AudioConfig.fromWavFileInput(fs.readFileSync("YourAudioFile.wav"));