fix config and stt task for altLanguages (#575)

* fix config and stt task for altLanguages

* clear freeswitch channel var when altLanguages is empty list
This commit is contained in:
Hoan Luu Huu
2023-12-26 10:21:34 +07:00
committed by GitHub
parent 2ec1460b4e
commit 9eb315ecd6
5 changed files with 142 additions and 25 deletions

View File

@@ -64,14 +64,7 @@ class TaskTranscribe extends SttTask {
this.logger.debug({hints: this.data.recognizer.hints, hintsBoost: this.data.recognizer.hintsBoost},
'Transcribe:exec - applying global sttHints');
}
if (cs.hasAltLanguages) {
this.data.recognizer.altLanguages = this.data.recognizer.altLanguages.concat(cs.altLanguages);
this.logger.debug({altLanguages: this.altLanguages},
'Transcribe:exec - applying altLanguages');
}
if (cs.hasGlobalSttPunctuation && !this.data.recognizer.punctuation) {
this.data.recognizer.punctuation = cs.globalSttPunctuation;
}
try {
await this._startTranscribing(cs, ep, 1);
if (this.separateRecognitionPerChannel && ep2) {