fix transcribe

This commit is contained in:
Quan HL
2023-08-18 10:24:41 +07:00
parent e9f2837370
commit 09961f564a
2 changed files with 101 additions and 48 deletions

View File

@@ -226,17 +226,23 @@ class TaskGather extends Task {
this.language = cs.speechRecognizerLanguage;
if (this.data.recognizer) this.data.recognizer.language = this.language;
}
this.fallbackVendor = this.data.recognizer && this.data.recognizer.fallbackVendor !== 'default' ?
this.data.recognizer.fallbackVendor :
cs.fallbackSpeechRecognizerVendor;
this.fallbackLanguage = this.data.recognizer && this.data.recognizer.fallbackLanguage !== 'default' ?
this.data.recognizer.fallbackLanguage :
cs.fallbackSpeechRecognizerLanguage;
this.fallbackLabel = this.data.recognizer && this.data.recognizer.fallbackLabel !== 'default' ?
this.data.recognizer.fallbackLabel :
cs.fallbackSpeechRecognizerLabel;
if ('default' === this.label || !this.label) {
this.label = cs.speechRecognizerLabel;
if (this.data.recognizer) this.data.recognizer.label = this.label;
}
// Fallback options
if ('default' === this.fallbackVendor || !this.fallbackVendor) {
this.fallbackVendor = cs.fallbackSpeechRecognizerVendor;
if (this.data.recognizer) this.data.recognizer.fallbackVendor = this.fallbackVendor;
}
if ('default' === this.fallbackLanguage || !this.fallbackLanguage) {
this.fallbackLanguage = cs.fallbackSpeechRecognizerLanguage;
if (this.data.recognizer) this.data.recognizer.fallbackLanguage = this.fallbackLanguage;
}
if ('default' === this.fallbackLabel || !this.fallbackLabel) {
this.fallbackLabel = cs.fallbackSpeechRecognizerLabel;
if (this.data.recognizer) this.data.recognizer.fallbackLabel = this.fallbackLabel;
}
if (!this.data.recognizer.vendor) {
this.data.recognizer.vendor = this.vendor;