update transcribe to support google v1p1beta1 and aws

This commit is contained in:
Dave Horton
2021-01-31 15:49:19 -05:00
parent 59d685319e
commit 756db59671
7 changed files with 243 additions and 97 deletions

View File

@@ -10,15 +10,18 @@ class TaskGather extends Task {
[
'finishOnKey', 'hints', 'input', 'numDigits',
'partialResultHook', 'profanityFilter',
'partialResultHook',
'speechTimeout', 'timeout', 'say', 'play'
].forEach((k) => this[k] = this.data[k]);
this.timeout = (this.timeout || 5) * 1000;
this.interim = this.partialResultCallback;
if (this.data.recognizer) {
this.language = this.data.recognizer.language || 'en-US';
this.vendor = this.data.recognizer.vendor;
const recognizer = this.data.recognizer;
this.language = recognizer.language;
if (recognizer.hints && recognizer.hints.length > 0) {
this.hints = recognizer.hints.join(',');
}
}
this.digitBuffer = '';