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
This commit is contained in:
Hoan Luu Huu
2024-08-08 18:50:46 +07:00
committed by GitHub
parent 689e55bdf0
commit d3eb106d5d

View File

@@ -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();
}