[DialogProcessor] fix race condition (#2761)

Signed-off-by: Miguel Álvarez Díez <miguelwork92@gmail.com>
pull/2792/head
GiviMAD 2022-02-20 14:35:41 +01:00 committed by GitHub
parent c300410fd9
commit 417098e1ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -244,7 +244,6 @@ public class DialogProcessor implements KSListener, STTListener {
public synchronized void sttEventReceived(STTEvent sttEvent) {
if (sttEvent instanceof SpeechRecognitionEvent) {
if (!isSTTServerAborting) {
abortSTT();
SpeechRecognitionEvent sre = (SpeechRecognitionEvent) sttEvent;
String question = sre.getTranscript();
try {
@ -256,6 +255,7 @@ public class DialogProcessor implements KSListener, STTListener {
say(msg);
}
}
abortSTT();
}
} else if (sttEvent instanceof RecognitionStartEvent) {
toggleProcessing(true);