From d3eb106d5d9151c12eae1510fefe1f04bae82779 Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Thu, 8 Aug 2024 18:50:46 +0700 Subject: [PATCH] clear gather timeout if imterim result received (#800) * clear gather timeout if imterim result received * fix to reset timeout timer if receive interrim result * fix to reset timeout timer if receive interrim result --- lib/tasks/gather.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index 9061741e..2e8de2cb 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -882,13 +882,15 @@ class TaskGather extends SttTask { this.cs.callInfo, httpHeaders)); } if (this.vendor === 'soniox') { - this._clearTimer(); if (evt.vendor.finalWords.length) { this.logger.debug({evt}, 'TaskGather:_onTranscription - buffering soniox transcript'); this._sonioxTranscripts.push(evt.vendor.finalWords); } } - + // If transcription received, reset timeout timer. + if (this._timeoutTimer) { + this._startTimer(); + } /* restart asr timer if we get a partial transcript */ if (this.isContinuousAsr) this._startAsrTimer(); }