changes for azure tts

This commit is contained in:
Dave Horton
2021-11-19 18:23:23 +00:00
parent 7c77bedd15
commit 12c34de15c
5 changed files with 538 additions and 5042 deletions

View File

@@ -21,19 +21,15 @@ class TaskSay extends Task {
const {updateSpeechCredentialLastUsed} = require('../utils/db-utils')(this.logger, srf);
const {writeAlerts, AlertType, stats} = srf.locals;
const {synthAudio} = srf.locals.dbHelpers;
const vendor = ('default' === this.synthesizer.vendor || !this.synthesizer.vendor) ?
cs.speechSynthesisVendor :
this.synthesizer.vendor;
const language = ('default' === this.synthesizer.language || !this.synthesizer.language) ?
cs.speechSynthesisLanguage :
this.synthesizer.language;
const voice = ('default' === this.synthesizer.voice || !this.synthesizer.voice) ?
cs.speechSynthesisVoice :
this.synthesizer.voice;
const hasVerbLevelTts = this.synthesizer.vendor && this.synthesizer.vendor !== 'default';
const vendor = hasVerbLevelTts ? this.synthesizer.vendor : cs.speechSynthesisVendor ;
const language = hasVerbLevelTts ? this.synthesizer.language : cs.speechSynthesisLanguage ;
const voice = hasVerbLevelTts ? this.synthesizer.voice : cs.speechSynthesisVoice ;
const salt = cs.callSid;
const credentials = cs.getSpeechCredentials(vendor, 'tts');
this.logger.info(`Task:say - using vendor: ${vendor}`);
this.logger.info({language, voice}, `Task:say - using vendor: ${vendor}`);
this.ep = ep;
try {
if (!credentials) {