reuse sdk.AudioInputStream.createPushStream() with same data gives another recognizer.recognizeOnceAsync result
See original GitHub issueI used the provided node.js sample to experiment. When I want to reuse/loop my code, the recognize results are wrong. The first loop the result is ok, but the next loops the results are all wrong. I problem seems to be the way I reuse/rebuild pushStream variable. I expect 5 times the same results, when I read 5 times the same WAV file and do 5 times the recognition.
`function loop() { // create the push stream we need for the speech sdk. var pushStream = undefined; pushStream = sdk.AudioInputStream.createPushStream();
// open the file and push it to the push stream. fs.createReadStream(filename).on(‘data’, function (arrayBuffer) { pushStream.write(arrayBuffer.buffer); }).on(‘end’, function () { pushStream.close(); analyse(pushStream); // Rest of sample code where recognition is done. When done, loop() is called again. }); }`
Expected behavior I try to reset all variables, so I expect the recognition result is always the same.
Version of the Cognitive Services Speech SDK 1.2.0
Platform, Operationg System, and Programming Language Node.js
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
Can you make sure it’s not the same issue as this: https://github.com/microsoft/cognitive-services-speech-sdk-js/issues/73
The sample had a bug in it with how the buffer was being passed…
It is the same, thank you!