try a different approach

This commit is contained in:
akirilyuk
2022-02-03 19:14:37 +01:00
parent 1fd94dce94
commit fce40a47ce
2 changed files with 10 additions and 9 deletions

View File

@@ -104,10 +104,12 @@ class TaskGather extends Task {
this.sayTask.on('playDone', async(err) => {
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){
startListening(cs, ep);
}
if (!this.killed) {
if (this.listenAfterSpeech) {
startListening(cs, ep);
} else {
this.notifyTaskDone();
}
}
});
}
@@ -116,7 +118,7 @@ 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) {
startListening(cs, ep);
startListening(cs, ep);
}}
);
}