From 5e1b826da4e8a946015a9cadae20ac979c8f5887 Mon Sep 17 00:00:00 2001 From: Vinod Dharashive Date: Tue, 25 Jun 2024 22:59:28 +0530 Subject: [PATCH] Aws polly engine fix (#789) * Aws polly engine fix engine parameter was not able to change using synthesizer * WIP code correction and set default engine to Neural * WIP * WIP Updated tts-task.js * WIP --- lib/tasks/say.js | 4 ++-- lib/tasks/tts-task.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tasks/say.js b/lib/tasks/say.js index 8af575e3..b6c530cb 100644 --- a/lib/tasks/say.js +++ b/lib/tasks/say.js @@ -66,7 +66,7 @@ class TaskSay extends TtsTask { const {updateSpeechCredentialLastUsed} = require('../utils/db-utils')(this.logger, srf); const {writeAlerts, AlertType, stats} = srf.locals; const {synthAudio} = srf.locals.dbHelpers; - const engine = this.synthesizer.engine || 'standard'; + const engine = this.synthesizer.engine || cs.synthesizer?.engine || 'neural'; const salt = cs.callSid; let credentials = cs.getSpeechCredentials(vendor, 'tts', label); @@ -204,7 +204,7 @@ class TaskSay extends TtsTask { const {srf, accountSid:account_sid} = cs; const {writeAlerts, AlertType} = srf.locals; const {addFileToCache} = srf.locals.dbHelpers; - const engine = this.synthesizer.engine || 'standard'; + const engine = this.synthesizer.engine || cs.synthesizer?.engine || 'neural'; await super.exec(cs); this.ep = ep; diff --git a/lib/tasks/tts-task.js b/lib/tasks/tts-task.js index 5de6b027..ad03eb48 100644 --- a/lib/tasks/tts-task.js +++ b/lib/tasks/tts-task.js @@ -31,7 +31,7 @@ class TtsTask extends Task { const {updateSpeechCredentialLastUsed} = require('../utils/db-utils')(this.logger, srf); const {writeAlerts, AlertType, stats} = srf.locals; const {synthAudio} = srf.locals.dbHelpers; - const engine = this.synthesizer.engine || 'standard'; + const engine = this.synthesizer.engine || cs.synthesizer?.engine || 'neural'; const salt = cs.callSid; let credentials = cs.getSpeechCredentials(vendor, 'tts', label);