Bugfix/config stt punctuation (#164)

* support recognizer.punctuation in config verb (#163)

* fixes from testing
This commit is contained in:
Dave Horton
2022-09-13 11:45:36 +02:00
committed by GitHub
parent bf7ece8f17
commit c88163fe11
4 changed files with 21 additions and 0 deletions

View File

@@ -286,6 +286,18 @@ class CallSession extends Emitter {
return this._globalAltLanguages;
}
set globalSttPunctuation(punctuate) {
this._globalSttPunctuation = punctuate;
}
get globalSttPunctuation() {
return this._globalSttPunctuation;
}
hasGlobalSttPunctuation() {
return this._globalSttPunctuation !== undefined;
}
async notifyRecordOptions(opts) {
const {action} = opts;
this.logger.debug({opts}, 'CallSession:notifyRecordOptions');

View File

@@ -98,6 +98,9 @@ class TaskConfig extends Task {
this.logger.info({altLanguages: this.recognizer.altLanguages}, 'Config: updated altLanguages');
cs.altLanguages = this.recognizer.altLanguages;
}
if ('punctuation' in this.recognizer) {
cs.globalSttPunctuation = this.recognizer.punctuation;
}
this.logger.info({
recognizer: this.recognizer,
isContinuousAsr: cs.isContinuousAsr

View File

@@ -146,6 +146,9 @@ class TaskGather extends Task {
this.logger.debug({altLanguages: this.altLanguages},
'Gather:exec - applying altLanguages');
}
if (cs.hasGlobalSttPunctuation) {
this.punctuation = cs.globalSttPunctuation;
}
if (!this.isContinuousAsr && cs.isContinuousAsr) {
this.isContinuousAsr = true;
this.asrTimeout = cs.asrTimeout * 1000;

View File

@@ -74,6 +74,9 @@ class TaskTranscribe extends Task {
this.logger.debug({altLanguages: this.altLanguages},
'Gather:exec - applying altLanguages');
}
if (cs.hasGlobalSttPunctuation) {
this.punctuation = cs.globalSttPunctuation;
}
this.ep = ep;
this.ep2 = ep2;