deepgram sends transcripts with empty alternatives array

This commit is contained in:
Dave Horton
2024-04-03 08:59:48 -04:00
parent 8fbbd2deb4
commit 05a379de15

View File

@@ -338,7 +338,7 @@ class TaskTranscribe extends SttTask {
let emptyTranscript = false;
if (evt.is_final) {
if (evt.alternatives[0].transcript === '' && !cs.callGone && !this.killed) {
if (evt.alternatives.length === 0 || evt.alternatives[0].transcript === '' && !cs.callGone && !this.killed) {
emptyTranscript = true;
if (finished === 'true' &&
['microsoft', 'deepgram'].includes(this.vendor) &&