feat/864: enable bargeIn when minBargeinWordCount is 0 (#900)

* feat/864: checking for undefined, because 0 is a valid value for minBargeinWordCount

* feat/864: checking for undefined and null

* feat/864: corrected spelling of mode and added check for undefined as 0 is a valid value for vad.mode
This commit is contained in:
rammohan-y
2024-09-17 22:56:29 +05:30
committed by GitHub
parent 7daf056d6b
commit 7bbfc01cb0

View File

@@ -34,7 +34,8 @@ class TaskConfig extends Task {
'finishOnKey', 'input', 'numDigits', 'minDigits', 'maxDigits', 'finishOnKey', 'input', 'numDigits', 'minDigits', 'maxDigits',
'interDigitTimeout', 'bargein', 'dtmfBargein', 'minBargeinWordCount', 'actionHook' 'interDigitTimeout', 'bargein', 'dtmfBargein', 'minBargeinWordCount', 'actionHook'
].forEach((k) => { ].forEach((k) => {
if (this.bargeIn[k]) this.gatherOpts[k] = this.bargeIn[k]; const val = this.bargeIn[k];
if (val !== undefined && val !== null) this.gatherOpts[k] = val;
}); });
} }
if (this.transcribe?.enable) { if (this.transcribe?.enable) {
@@ -295,7 +296,7 @@ class TaskConfig extends Task {
voiceMs: this.vad.voiceMs || 250, voiceMs: this.vad.voiceMs || 250,
silenceMs: this.vad.silenceMs || 150, silenceMs: this.vad.silenceMs || 150,
strategy: this.vad.strategy || 'one-shot', strategy: this.vad.strategy || 'one-shot',
mode: this.vad.mod || 2 mode: (this.vad.mode !== undefined && this.vad.mode !== null) ? this.vad.mode : 2
}; };
} }
} }