add stability instead of final

This commit is contained in:
akirilyuk
2022-02-03 22:10:40 +01:00
parent f1c17e537d
commit 09c2608114

View File

@@ -314,7 +314,7 @@ class TaskGather extends Task {
} }
if (evt.is_final) this._resolve('speech', evt); if (evt.is_final) this._resolve('speech', evt);
else { 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.logger.debug('Gather:_onTranscription - killing audio due to bargein');
this._killAudio(cs); this._killAudio(cs);
this._resolve('speech', evt); this._resolve('speech', evt);