bugfix: azure stt - if we get no speech detected, listen again

This commit is contained in:
Dave Horton
2022-04-13 12:07:30 -04:00
parent 6330b0d443
commit 29dec24095
2 changed files with 8 additions and 2 deletions

View File

@@ -385,7 +385,7 @@ class TaskGather extends Task {
}
}
if (evt.is_final) {
if (evt.alternatives[0].transcript === '' && !this.callSession.callGonen && !this.killed) {
if (evt.alternatives[0].transcript === '' && !this.callSession.callGone && !this.killed) {
this.logger.info({evt}, 'TaskGather:_onTranscription - got empty transcript, listen again');
return this._startTranscribing(ep);
}
@@ -433,7 +433,10 @@ class TaskGather extends Task {
}
_onNoSpeechDetected(cs, ep) {
this._resolve('timeout');
if (!this.callSession.callGone && !this.killed) {
this.logger.debug('TaskGather:_onNoSpeechDetected - listen again');
return this._startTranscribing(ep);
}
}
async _resolve(reason, evt) {