use stability for bargein feature

This commit is contained in:
akirilyuk
2022-02-03 22:12:47 +01:00
parent 09c2608114
commit 6960466afc

View File

@@ -111,7 +111,11 @@ class TaskGather extends Task {
if (err) return this.logger.error({err}, 'Gather:exec Error playing tts');
this.logger.debug('Gather: say task completed');
if (!this.killed) {
if (this.listenAfterSpeech === true) {
startListening(cs, ep);
} else {
this.notifyTaskDone();
}
}
});
}
@@ -126,8 +130,13 @@ class TaskGather extends Task {
this.playTask.on('playDone', async(err) => {
if (err) return this.logger.error({err}, 'Gather:exec Error playing url');
if (!this.killed) {
if (this.listenAfterSpeech === true) {
startListening(cs, ep);
}}
} else {
this.notifyTaskDone();
}
}
}
);
}
else startListening(cs, ep);