[DialogProcessor] fix race condition (#2761)
Signed-off-by: Miguel Álvarez Díez <miguelwork92@gmail.com>pull/2792/head
parent
c300410fd9
commit
417098e1ad
|
@ -244,7 +244,6 @@ public class DialogProcessor implements KSListener, STTListener {
|
||||||
public synchronized void sttEventReceived(STTEvent sttEvent) {
|
public synchronized void sttEventReceived(STTEvent sttEvent) {
|
||||||
if (sttEvent instanceof SpeechRecognitionEvent) {
|
if (sttEvent instanceof SpeechRecognitionEvent) {
|
||||||
if (!isSTTServerAborting) {
|
if (!isSTTServerAborting) {
|
||||||
abortSTT();
|
|
||||||
SpeechRecognitionEvent sre = (SpeechRecognitionEvent) sttEvent;
|
SpeechRecognitionEvent sre = (SpeechRecognitionEvent) sttEvent;
|
||||||
String question = sre.getTranscript();
|
String question = sre.getTranscript();
|
||||||
try {
|
try {
|
||||||
|
@ -256,6 +255,7 @@ public class DialogProcessor implements KSListener, STTListener {
|
||||||
say(msg);
|
say(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
abortSTT();
|
||||||
}
|
}
|
||||||
} else if (sttEvent instanceof RecognitionStartEvent) {
|
} else if (sttEvent instanceof RecognitionStartEvent) {
|
||||||
toggleProcessing(true);
|
toggleProcessing(true);
|
||||||
|
|
Loading…
Reference in New Issue