Speech to text service is giving very late responses
Speech translation is taking approx. 15 sec for translating the 22 sec audio. I have tried with both recognizeOnceAsync and startContinuousRecgnitionAsync but , there is no change in the response time. Kindly suggest some solution for the same.
I am Using NodeJS SDK
recognizer.sessionStopped = (s, e) => {
console.log("\n Session stopped event.");
recognizer.stopContinuousRecognitionAsync();
};
recognizer.recognizeOnceAsync((result, err) => {
console.log(RECOGNIZED: Text=${result}, result);
switch (result.reason) {
case sdk.ResultReason.RecognizedSpeech:
console.log(RECOGNIZED: Text=${result.text});
break;
case sdk.ResultReason.NoMatch:
console.log("NOMATCH: Speech could not be recognized.");
break;
case sdk.ResultReason.Canceled:
const cancellation = CancellationDetails.fromResult(result);
console.log(CANCELED: Reason=${cancellation.reason});
if (cancellation.reason == sdk.CancellationReason.Error) {
console.log(CANCELED: ErrorCode=${cancellation.ErrorCode});
console.log(CANCELED: ErrorDetails=${cancellation.errorDetails});
console.log("CANCELED: Did you update the key and location/region info?");
}
break;
}
var pronunciationAssessmentResult = sdk.PronunciationAssessmentResult.fromResult(result);
//console.log(" pronunciationAssessmentResult", pronunciationAssessmentResult);
console.log(" pronunciationAssessmentResult.pronunciationScore", pronunciationAssessmentResult.pronunciationScore);
console.log(" pronunciationAssessmentResult.fluencyScore", pronunciationAssessmentResult.fluencyScore);
endTime = (new Date()).getTime()
console.log('Took ' + (endTime - startTime) + 'ms');
recognizer.close();
});