From e57c7ba90a709216f10746eaec885452cd949a7a Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Thu, 25 Jan 2024 08:46:57 -0500 Subject: [PATCH] fix for #627 (#628) --- lib/tasks/gather.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index d19a3b3c..09a1cf2d 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -499,7 +499,9 @@ class TaskGather extends SttTask { if (this._timeoutTimer) { clearTimeout(this._timeoutTimer); this._timeoutTimer = null; + return true; } + return false; } _startAsrTimer() { @@ -701,8 +703,7 @@ class TaskGather extends SttTask { } } else { - this._clearTimer(); - this._startTimer(); + if (this._clearTimer()) this._startTimer(); if (this.bargein && (words + bufferedWords) >= this.minBargeinWordCount) { if (!this.playComplete) { this.logger.debug({transcript: evt.alternatives[0].transcript}, 'killing audio due to speech');