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

@@ -116,14 +116,6 @@ class TaskGather extends SttTask {
this.logger.debug({hints: this.data.recognizer.hints, hintsBoost: this.data.recognizer.hintsBoost},
'Gather:exec - applying global sttHints');
}
if (cs.hasAltLanguages) {
this.data.recognizer.altLanguages = this.data.recognizer.altLanguages.concat(cs.altLanguages);
this.logger.debug({altLanguages: this.data.recognizer?.altLanguages},
'Gather:exec - applying altLanguages');
}
if (cs.hasGlobalSttPunctuation && !this.data.recognizer.punctuation) {
this.data.recognizer.punctuation = cs.globalSttPunctuation;
}
if (!this.isContinuousAsr && cs.isContinuousAsr) {
this.isContinuousAsr = true;
this.asrTimeout = cs.asrTimeout * 1000;