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');