fix setting initial config

This commit is contained in:
akirilyuk
2022-02-04 08:12:53 +01:00
parent eb418a42e9
commit 418baa20df
3 changed files with 29 additions and 32 deletions

View File

@@ -130,10 +130,10 @@ class TaskGather extends Task {
else startListening(cs, ep);
if (this.input.includes('speech') && this.listenDuringPrompt) {
await this._initSpeech(cs, ep);
this._startTranscribing(ep);
updateSpeechCredentialLastUsed(this.sttCredentials.speech_credential_sid)
.catch(() => {/*already logged error */});
await this._initSpeech(cs, ep);
this._startTranscribing(ep);
updateSpeechCredentialLastUsed(this.sttCredentials.speech_credential_sid)
.catch(() => {/*already logged error */});
}
if (this.input.includes('digits') || this.dtmfBargein) {
@@ -318,7 +318,9 @@ class TaskGather extends Task {
}
if (evt.is_final) this._resolve('speech', evt);
else {
if (evt.stability > 0.70 && this.bargein && evt.alternatives[0].transcript.split(' ').length >= this.minBargeinWordCount) {
if (evt.stability > 0.70 &&
this.bargein &&
evt.alternatives[0].transcript.split(' ').length >= this.minBargeinWordCount) {
this.logger.debug('Gather:_onTranscription - killing audio due to bargein');
this._killAudio(cs);
this._resolve('speech', evt);