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();
}
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;