fix default gather input is digits and gather dtmf should not require speech

This commit is contained in:
Quan HL
2024-01-31 11:46:29 +07:00
parent 0491c5ce25
commit 5b607693dc
2 changed files with 10 additions and 1 deletions

View File

@@ -110,7 +110,12 @@ class SttTask extends Task {
this.data.recognizer.model = cs.speechRecognizerLanguage;
}
if (!this.sttCredentials) {
if (
// not gather task, such as transcribe
(!this.input ||
// gather task with speech
this.input.includes('speech')) &&
!this.sttCredentials) {
try {
this.sttCredentials = await this._initSpeechCredentials(this.cs, this.vendor, this.label);
} catch (error) {