diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index 004207dd..05c02c43 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -46,6 +46,8 @@ class TaskGather extends Task { get name() { return TaskName.Gather; } + get needsStt() { return this.input.includes('speech'); } + get earlyMedia() { return (this.sayTask && this.sayTask.earlyMedia) || (this.playTask && this.playTask.earlyMedia); @@ -59,7 +61,7 @@ class TaskGather extends Task { if ('default' === this.vendor || !this.vendor) this.vendor = cs.speechRecognizerVendor; if ('default' === this.language || !this.language) this.language = cs.speechRecognizerLanguage; this.sttCredentials = cs.getSpeechCredentials(this.vendor, 'stt'); - if (!this.sttCredentials) { + if (this.needsStt && !this.sttCredentials) { const {writeAlerts, AlertType} = cs.srf.locals; this.logger.info(`TaskGather:exec - ERROR stt using ${this.vendor} requested but not creds supplied`); writeAlerts({