fire end of stream at turn.end, not at speech.end

This commit is contained in:
Friedel van Megen 2018-12-17 22:23:59 +01:00
Родитель f495d7423a
Коммит bf94d4cef1
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -349,12 +349,12 @@ export abstract class ServiceRecognizerBase implements IDisposable {
if (!!this.privRecognizer.speechEndDetected) { if (!!this.privRecognizer.speechEndDetected) {
this.privRecognizer.speechEndDetected(this.privRecognizer, speechStopEventArgs); this.privRecognizer.speechEndDetected(this.privRecognizer, speechStopEventArgs);
} }
break;
case "turn.end":
if (requestSession.isSpeechEnded && this.privRecognizerConfig.isContinuousRecognition) { if (requestSession.isSpeechEnded && this.privRecognizerConfig.isContinuousRecognition) {
this.cancelRecognitionLocal(requestSession, CancellationReason.EndOfStream, CancellationErrorCode.NoError, undefined, successCallback); this.cancelRecognitionLocal(requestSession, CancellationReason.EndOfStream, CancellationErrorCode.NoError, undefined, successCallback);
} }
break;
case "turn.end":
const sessionStopEventArgs: SessionEventArgs = new SessionEventArgs(requestSession.sessionId); const sessionStopEventArgs: SessionEventArgs = new SessionEventArgs(requestSession.sessionId);
requestSession.onServiceTurnEndResponse(this.privRecognizerConfig.isContinuousRecognition); requestSession.onServiceTurnEndResponse(this.privRecognizerConfig.isContinuousRecognition);
if (!this.privRecognizerConfig.isContinuousRecognition || requestSession.isSpeechEnded) { if (!this.privRecognizerConfig.isContinuousRecognition || requestSession.isSpeechEnded) {