Skip to content

Commit

Permalink
speechmatics: continousAsr should be at least equal to max_delay, if set
Browse files Browse the repository at this point in the history
  • Loading branch information
davehorton committed Jan 16, 2025
1 parent a65ec9b commit b571fd8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/tasks/gather.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ class TaskGather extends SttTask {

// specials case for speechmatics: they dont do endpointing so we need to enable continuous ASR
if (this.vendor === 'speechmatics' && !this.isContinuousAsr) {
this.asrTimeout = SPEECHMATICS_DEFAULT_ASR_TIMEOUT;
const maxDelay = this.recognizer?.speechmaticsOptions?.transcription_config?.max_delay;
if (maxDelay) this.asrTimeout = Math.min(SPEECHMATICS_DEFAULT_ASR_TIMEOUT, maxDelay * 1000);
else this.asrTimeout = SPEECHMATICS_DEFAULT_ASR_TIMEOUT;
this.isContinuousAsr = true;
this.logger.debug(`Gather:exec - auto-enabling continuous ASR for speechmatics w/ timeout ${this.asrTimeout}`);
}
Expand Down

0 comments on commit b571fd8

Please sign in to comment.