I've implemented a Speech to Text conversion using Cognitive Services. I need it to stop listening after staying active for some specific time.
In C# version of the SDK, there is a method to make it stop listening as specified here.
Sample - // Stops recognition.
await recognizer.StopContinuousRecognitionAsync().ConfigureAwait(false);
I was looking similar method in JavaScript sdk but couldn't find any. So is there any way to make it stop listening?
EDIT - Adding my code sample-
var recognizer = new scope.SDK.SpeechRecognizer(speechConfig, audioConfig);
recognizer.recognizeOnceAsync(function (result) {
console.log(result.text)
})
I need it to stop it even while it is listening to something.
Thanks.
recognizer.stopContinuousRecognitionAsync()
is the method you're looking for.