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

abdou abdou 1 Reputation point
2022-02-09T11:33:15.98+00:00

Any one can help me please with this issue ?

https://github.com/glharper/cognitive-js-sdk-react-native/issues/2

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

1 answer

Sort by: Most helpful
  1. Ramr-msft 17,826 Reputation points
    2022-02-10T12:21:29.18+00:00

    @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"));


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.