try something else

This commit is contained in:
akirilyuk
2022-02-03 18:31:42 +01:00
parent 4e2feda7f3
commit 1050eb47cd

View File

@@ -25,8 +25,7 @@ class TaskGather extends Task {
this.minBargeinWordCount = this.data.minBargeinWordCount || 1;
// this is specially for barge in where we want to make a bargebale promt
// to a user without listening after the say task has finished
this.listenAfterSpeech = this.data.listenAfterSpeech === false;
this.timeout = (this.timeout || 15) * 1000;
this.timeout = this.data.listenAfterSpeech === false ? 0 : (this.timeout || 15) * 1000;
this.interim = this.partialResultCallback || this.bargein;
if (this.data.recognizer) {
const recognizer = this.data.recognizer;
@@ -105,13 +104,9 @@ 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) {
startListening(cs, ep);
} else {
setTimeout(()=>{
this.kill(cs);
},1000)
}
}
});
}