diff --git a/lib/tasks/cognigy.js b/lib/tasks/cognigy.js index 13fa5765..06b42edc 100644 --- a/lib/tasks/cognigy.js +++ b/lib/tasks/cognigy.js @@ -126,7 +126,8 @@ class Cognigy extends Task { const opts = { recognizer: this.data.recognizer || { vendor: 'default', - language: 'default' + language: 'default', + outputFormat: 'detailed' } }; this.logger.debug({opts}, 'constructing a nested transcribe object'); diff --git a/lib/tasks/transcribe.js b/lib/tasks/transcribe.js index f56f4bc0..0f768097 100644 --- a/lib/tasks/transcribe.js +++ b/lib/tasks/transcribe.js @@ -216,12 +216,18 @@ class TaskTranscribe extends Task { if ('aws' === this.vendor && Array.isArray(evt) && evt.length > 0) evt = evt[0]; if ('microsoft' === this.vendor) { const nbest = evt.NBest; - const alternatives = nbest.map((n) => { + const alternatives = nbest ? nbest.map((n) => { return { confidence: n.Confidence, transcript: n.Display }; - }); + }) : + [ + { + transcript: evt.DisplayText + } + ]; + const newEvent = { is_final: evt.RecognitionStatus === 'Success', alternatives