From 647f4ab51cc6edcde16710e4cdf0ccca81963c9a Mon Sep 17 00:00:00 2001 From: xquanluu Date: Wed, 17 Dec 2025 15:28:29 +0700 Subject: [PATCH] wip --- lib/tasks/gather.js | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index 5acf7863..d25424c2 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -258,15 +258,18 @@ class TaskGather extends SttTask { startDtmfListener(); } this._stopVad(); - if (!this.killed && !this.resolved && !this.listenDuringPrompt) { - startListening(cs, ep); - } - if (this.input.includes('speech') && this.vendor === 'nuance' && this.listenDuringPrompt) { - this.logger.debug('Gather:exec - starting transcription timers after say completes'); - ep.startTranscriptionTimers((err) => { - if (err) this.logger.error({err}, 'Gather:exec - error starting transcription timers'); - }); + if (!this.killed && !this.resolved) { + if (!this.listenDuringPrompt) { + startListening(cs, ep); + } + if (this.input.includes('speech') && this.vendor === 'nuance' && this.listenDuringPrompt) { + this.logger.debug('Gather:exec - starting transcription timers after say completes'); + ep.startTranscriptionTimers((err) => { + if (err) this.logger.error({err}, 'Gather:exec - error starting transcription timers'); + }); + } } + }; this.sayTask.span = span; this.sayTask.ctx = ctx; @@ -296,15 +299,18 @@ class TaskGather extends SttTask { startDtmfListener(); } this._stopVad(); - if (!this.killed && !this.resolved && !this.listenDuringPrompt) { - startListening(cs, ep); - } - if (this.input.includes('speech') && this.vendor === 'nuance' && this.listenDuringPrompt) { - this.logger.debug('Gather:exec - starting transcription timers after play completes'); - ep.startTranscriptionTimers((err) => { - if (err) this.logger.error({err}, 'Gather:exec - error starting transcription timers'); - }); + if (!this.killed && !this.resolved) { + if (!this.listenDuringPrompt) { + startListening(cs, ep); + } + if (this.input.includes('speech') && this.vendor === 'nuance' && this.listenDuringPrompt) { + this.logger.debug('Gather:exec - starting transcription timers after play completes'); + ep.startTranscriptionTimers((err) => { + if (err) this.logger.error({err}, 'Gather:exec - error starting transcription timers'); + }); + } } + }; this.playTask.span = span; this.playTask.ctx = ctx;