This commit is contained in:
xquanluu
2025-12-17 15:28:29 +07:00
parent 922a034b2c
commit 647f4ab51c

View File

@@ -258,15 +258,18 @@ class TaskGather extends SttTask {
startDtmfListener(); startDtmfListener();
} }
this._stopVad(); this._stopVad();
if (!this.killed && !this.resolved && !this.listenDuringPrompt) { if (!this.killed && !this.resolved) {
startListening(cs, ep); 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'); if (this.input.includes('speech') && this.vendor === 'nuance' && this.listenDuringPrompt) {
ep.startTranscriptionTimers((err) => { this.logger.debug('Gather:exec - starting transcription timers after say completes');
if (err) this.logger.error({err}, 'Gather:exec - error starting transcription timers'); ep.startTranscriptionTimers((err) => {
}); if (err) this.logger.error({err}, 'Gather:exec - error starting transcription timers');
});
}
} }
}; };
this.sayTask.span = span; this.sayTask.span = span;
this.sayTask.ctx = ctx; this.sayTask.ctx = ctx;
@@ -296,15 +299,18 @@ class TaskGather extends SttTask {
startDtmfListener(); startDtmfListener();
} }
this._stopVad(); this._stopVad();
if (!this.killed && !this.resolved && !this.listenDuringPrompt) { if (!this.killed && !this.resolved) {
startListening(cs, ep); 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'); if (this.input.includes('speech') && this.vendor === 'nuance' && this.listenDuringPrompt) {
ep.startTranscriptionTimers((err) => { this.logger.debug('Gather:exec - starting transcription timers after play completes');
if (err) this.logger.error({err}, 'Gather:exec - error starting transcription timers'); ep.startTranscriptionTimers((err) => {
}); if (err) this.logger.error({err}, 'Gather:exec - error starting transcription timers');
});
}
} }
}; };
this.playTask.span = span; this.playTask.span = span;
this.playTask.ctx = ctx; this.playTask.ctx = ctx;