diff --git a/lib/tasks/say.js b/lib/tasks/say.js index be6312ad..edf80507 100644 --- a/lib/tasks/say.js +++ b/lib/tasks/say.js @@ -240,6 +240,7 @@ class TaskSay extends TtsTask { language, voice, engine, + model: this.model || this.model_id, text }).catch((err) => this.logger.info({err}, 'Error adding file to cache')); } diff --git a/lib/tasks/tts-task.js b/lib/tasks/tts-task.js index 6c9a58c8..e942fdb7 100644 --- a/lib/tasks/tts-task.js +++ b/lib/tasks/tts-task.js @@ -143,16 +143,16 @@ class TtsTask extends Task { `No text-to-speech service credentials for ${vendor} with labels: ${label} have been configured`); } /* parse Nuance voices into name and model */ - let model; if (vendor === 'nuance' && voice) { const arr = /([A-Za-z-]*)\s+-\s+(enhanced|standard)/.exec(voice); if (arr) { voice = arr[1]; - model = arr[2]; + this.model = arr[2]; } } else if (vendor === 'deepgram') { - model = voice; + this.model = voice; } + this.model_id = credentials.model_id; /* allow for microsoft custom region voice and api_key to be specified as an override */ if (vendor === 'microsoft' && this.options.deploymentId) { @@ -215,7 +215,8 @@ class TtsTask extends Task { // If vendor is changed from the previous one, then reset the cache_speech_handles flag //cs.currentTtsVendor = vendor; - if (!preCache && !this._disableTracing) this.logger.info({vendor, language, voice, model}, 'TaskSay:exec'); + if (!preCache && !this._disableTracing) + this.logger.info({vendor, language, voice, model: this.model}, 'TaskSay:exec'); try { if (!credentials) { writeAlerts({ @@ -250,7 +251,7 @@ class TtsTask extends Task { language, voice, engine, - model, + model: this.model, salt, credentials, options: this.options, diff --git a/package-lock.json b/package-lock.json index 4c21600a..bf1e0e99 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@jambonz/http-health-check": "^0.0.1", "@jambonz/mw-registrar": "^0.2.7", "@jambonz/realtimedb-helpers": "^0.8.8", - "@jambonz/speech-utils": "^0.2.1", + "@jambonz/speech-utils": "^0.2.2", "@jambonz/stats-collector": "^0.1.10", "@jambonz/time-series": "^0.2.13", "@jambonz/verb-specifications": "^0.0.95", @@ -1512,7 +1512,9 @@ } }, "node_modules/@jambonz/speech-utils": { - "version": "0.2.1", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@jambonz/speech-utils/-/speech-utils-0.2.2.tgz", + "integrity": "sha512-+O+5Ej6RhQZjbZLRbJSA4UT1Es2JcDSDJT24kGRSVWCf8SuG5B3TqKzZP0aaVA297I12b7ztNG9ShWjY0iR7Fg==", "license": "MIT", "dependencies": { "@aws-sdk/client-polly": "^3.496.0", diff --git a/package.json b/package.json index 5a36fd0d..22d38472 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@jambonz/http-health-check": "^0.0.1", "@jambonz/mw-registrar": "^0.2.7", "@jambonz/realtimedb-helpers": "^0.8.8", - "@jambonz/speech-utils": "^0.2.1", + "@jambonz/speech-utils": "^0.2.2", "@jambonz/stats-collector": "^0.1.10", "@jambonz/verb-specifications": "^0.0.95", "@jambonz/time-series": "^0.2.13",