start listeing if enabled

This commit is contained in:
akirilyuk
2022-02-03 18:54:57 +01:00
parent efba631282
commit 1fd94dce94

View File

@@ -105,14 +105,9 @@ class TaskGather extends Task {
if (err) return this.logger.error({err}, 'Gather:exec Error playing tts'); if (err) return this.logger.error({err}, 'Gather:exec Error playing tts');
this.logger.debug('Gather: say task completed'); this.logger.debug('Gather: say task completed');
if (!this.killed) { if (!this.killed) {
// if (this.listenAfterSpeech) { if(this.listenAfterSpeech){
startListening(cs, ep); startListening(cs, ep);
// } else { }
// setTimeout(()=>{
// this.kill(cs);
// },2000)
// }
} }
}); });
} }
@@ -121,11 +116,7 @@ class TaskGather extends Task {
this.playTask.on('playDone', async(err) => { this.playTask.on('playDone', async(err) => {
if (err) return this.logger.error({err}, 'Gather:exec Error playing url'); if (err) return this.logger.error({err}, 'Gather:exec Error playing url');
if (!this.killed) { if (!this.killed) {
if (this.listenAfterSpeech) {
startListening(cs, ep); startListening(cs, ep);
} else {
this.kill(cs);
}
}} }}
); );
} }