From 09c2608114dcd949d74cfdfcba364ac0d1238816 Mon Sep 17 00:00:00 2001 From: akirilyuk Date: Thu, 3 Feb 2022 22:10:40 +0100 Subject: [PATCH] add stability instead of final --- lib/tasks/gather.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index 4a3e42b0..68266bec 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -314,7 +314,7 @@ class TaskGather extends Task { } if (evt.is_final) this._resolve('speech', evt); else { - if (evt.is_final && this.bargein && evt.alternatives[0].transcript.split(' ').length >= this.minBargeinWordCount) { + if (evt.stability > 0.70 && this.bargein && evt.alternatives[0].transcript.split(' ').length >= this.minBargeinWordCount) { this.logger.debug('Gather:_onTranscription - killing audio due to bargein'); this._killAudio(cs); this._resolve('speech', evt);