support tts caching

This commit is contained in:
Dave Horton
2020-03-11 14:42:12 -04:00
parent afc1fd3639
commit 88e65c8836
5 changed files with 19 additions and 15 deletions

View File

@@ -25,7 +25,8 @@ function makeTask(logger, obj, parent) {
const TaskHangup = require('./hangup');
return new TaskHangup(logger, data, parent);
case TaskName.Say:
if (data.vendor === 'google' && !data.language) {
if (data.synthesizer.vendor === 'google' && !data.synthesizer.language) {
logger.debug('creating legacy say task');
const TaskSayLegacy = require('./say-legacy');
return new TaskSayLegacy(logger, data, parent);
}

View File

@@ -29,8 +29,8 @@ class TaskSay extends Task {
}, this.synthesizer);
while (!this.killed && this.loop--) {
this.logger.debug(`TaskSay: remaining loops ${this.loop}`);
if (!filepath) {
this.logger.debug('TaskSay:exec - retrieving synthesized audio');
filepath = await synthAudio(opts);
cs.trackTmpFile(filepath);
}

View File

@@ -190,11 +190,14 @@
"enum": ["google", "aws", "polly"]
},
"language": "string",
"voice": "string"
"voice": "string",
"gender": {
"type": "string",
"enum": ["MALE", "FEMALE", "NEUTRAL"]
}
},
"required": [
"vendor",
"language"
"vendor"
]
},
"recognizer": {