Using Speech SDK for JavaScript v1.44.0, and following the STT in-memory streaming example, but using the fromEndpoint API to create Recognizer, as recommended in the Release Notes for that SDK version. Node.js is v22 LTS, running in Azure Cloud as an Azure Web App. Azure Speech Service is in France Central.
Describe the bug
Call to create the SpeechRecognizer with the following error information:
**/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/Audio/AudioConfig.js:184 return this.privSource.id(); ^
TypeError: this.privSource.id is not a function at AudioConfigImpl.id (/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/Audio/AudioConfig.js:184:32) at new ServiceRecognizerBase (/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common.speech/ServiceRecognizerBase.js:63:88) at new SpeechServiceRecognizer (/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common.speech/SpeechServiceRecognizer.js:11:9) at SpeechRecognizer.createServiceRecognizer (/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/SpeechRecognizer.js:216:16) at SpeechRecognizer.implCommonRecognizerSetup (/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/Recognizer.js:102:30) at new Recognizer (/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/Recognizer.js:26:14) at new SpeechRecognizer (/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/SpeechRecognizer.js:26:9) at WebSocket. (/home/site/wwwroot/server.js:384:30) at WebSocket.emit (node:events:518:28) at Receiver.receiverOnMessage (/node_modules/ws/lib/websocket.js:1220:20)
Node.js v22.15.0**
To Reproduce
Create a node.js server in Azure Web App, create an Audio pushStream, then attempt to create a new SpeechRecognizer after a WebSocket client connects, like this:
let pushStream = sdkSpeech.AudioInputStream.createPushStream(audioStreamFormat);
// Get the audioConfig from STT Stream
let audioConfig = sdkSpeech.AudioConfig.fromStreamInput(pushStream);
// Prepare the recognizer
let recognizeSTT = new sdkSpeech.SpeechRecognizer(speechConfig, audioConfig);
Expected behavior
Speech Recognizer is created and ready to recognize speech from the audio stream!
Version of the Cognitive Services Speech SDK
1.44.0
Platform, Operating System, and Programming Language
OS: Linux in Azure Web App with node.js 22 LTS Hardware - Whatever Azure is Using! Programming language: JavaScript (node.js) Browser - not applicable Additional context
The error crashes the node.js server, and the crash occurs AS SOON AS the call to create the SpeechRecognizer is sent and BEFORE sending any audio data to the STT service!
Version
1.36.0 (Latest)
What browser/platform are you seeing the problem on?
Node
Relevant log output
/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/Audio/AudioConfig.js:184