bugfix: allow for empty transcripts that nuance returns

This commit is contained in:
Dave Horton
2023-03-27 14:13:39 -04:00
parent c0114015ea
commit 5131d524ce
2 changed files with 8 additions and 1 deletions

View File

@@ -560,6 +560,10 @@ class TaskGather extends Task {
}
evt = this.normalizeTranscription(evt, this.vendor, 1, this.language);
if (evt.alternatives.length === 0) {
this.logger.info({evt}, 'TaskGather:_onTranscription - got empty transcript, continue listening');
return;
}
if (this.earlyHintsMatch && evt.is_final === false) {
const transcript = evt.alternatives[0].transcript?.toLowerCase();