From 83a3bb61fedd9ea81bf2a01977fde6d872a080f7 Mon Sep 17 00:00:00 2001 From: akirilyuk Date: Fri, 4 Feb 2022 08:35:07 +0100 Subject: [PATCH] only set setting if we are making output in gather --- lib/tasks/gather.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index 57796d78..f801e6da 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -23,10 +23,8 @@ class TaskGather extends Task { ].forEach((k) => this[k] = this.data[k]); this.listenDuringPrompt = this.data.listenDuringPrompt === false ? false : true; this.minBargeinWordCount = this.data.minBargeinWordCount || 1; - // this is specially for barge in where we want to make a bargebale promt - // to a user without listening after the say task has finished + this.logger.debug({opts}, 'created gather task'); - this.listenAfterSpeech = typeof this.data.listenAfterSpeech === "boolean" ? this.data.listenAfterSpeech : true; this.timeout = (this.timeout || 15) * 1000; this.interim = this.partialResultCallback || this.bargein; if (this.data.recognizer) { @@ -54,6 +52,12 @@ class TaskGather extends Task { if (this.say) this.sayTask = makeTask(this.logger, {say: this.say}, this); if (this.play) this.playTask = makeTask(this.logger, {play: this.play}, this); + if(this.sayTask || this.playTask){ + // this is specially for barge in where we want to make a bargebale promt + // to a user without listening after the say task has finished + this.listenAfterSpeech = typeof this.data.listenAfterSpeech === "boolean" ? this.data.listenAfterSpeech : true; + } + this.parentTask = parentTask; }