diff --git a/lib/tasks/make_task.js b/lib/tasks/make_task.js index 13c3670e..a9913c1d 100644 --- a/lib/tasks/make_task.js +++ b/lib/tasks/make_task.js @@ -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); } diff --git a/lib/tasks/say.js b/lib/tasks/say.js index 82dc3756..cc6bc7d0 100644 --- a/lib/tasks/say.js +++ b/lib/tasks/say.js @@ -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); } diff --git a/lib/tasks/specs.json b/lib/tasks/specs.json index 4783c642..a0924591 100644 --- a/lib/tasks/specs.json +++ b/lib/tasks/specs.json @@ -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": { diff --git a/package-lock.json b/package-lock.json index 385e6951..b9af8740 100644 --- a/package-lock.json +++ b/package-lock.json @@ -393,9 +393,9 @@ "dev": true }, "aws-sdk": { - "version": "2.633.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.633.0.tgz", - "integrity": "sha512-C28/GefIQ+Dk1hjPQrpG1Yt9RdvqeFMP4nb6iActanoGq5JTSJU9103ukpBzrHz96fvjhIRogrvfOhDKubbcjw==", + "version": "2.637.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.637.0.tgz", + "integrity": "sha512-e7EYX5rNtQyEaleQylUtLSNKXOmvOwfifQ4bYkfF80mFsVI3DSydczLHXrqPzXoEJaS/GI/9HqVnlQcPs6Q3ew==", "requires": { "buffer": "4.9.1", "events": "1.1.1", @@ -1545,9 +1545,9 @@ "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==" }, "fast-text-encoding": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.0.tgz", - "integrity": "sha512-R9bHCvweUxxwkDwhjav5vxpFvdPGlVngtqmx4pIZfSUhM/Q4NiIUHB456BAf+Q1Nwu3HEZYONtu+Rya+af4jiQ==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.1.tgz", + "integrity": "sha512-x4FEgaz3zNRtJfLFqJmHWxkMDDvXVtaznj2V9jiP8ACUJrUgist4bP9FmDL2Vew2Y9mEQI/tG4GqabaitYp9CQ==" }, "figures": { "version": "3.2.0", @@ -2545,9 +2545,9 @@ } }, "jambonz-realtimedb-helpers": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/jambonz-realtimedb-helpers/-/jambonz-realtimedb-helpers-0.2.1.tgz", - "integrity": "sha512-dpRoAfFQKNthiYZdzv9vTAM0NT/sjqGkYKClA+8HArsnRVQwbfrP0HERKOB6/mlIigNCm8GTD3BsUNAfYebnrw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/jambonz-realtimedb-helpers/-/jambonz-realtimedb-helpers-0.2.2.tgz", + "integrity": "sha512-aOBQBB/RVilXXCXWZRyJcgAZh1mYk9YsinOVdPXax+QKDVoKGY43mngYQ/7SRfCagcsHrc+cpzwGSox7Aixiew==", "requires": { "@google-cloud/text-to-speech": "^2.2.0", "aws-sdk": "^2.631.0", diff --git a/package.json b/package.json index 6d27c27b..e957bbeb 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "ip": "^1.1.5", "jambonz-db-helpers": "^0.3.2", "jambonz-mw-registrar": "^0.1.3", - "jambonz-realtimedb-helpers": "^0.2.1", + "jambonz-realtimedb-helpers": "^0.2.2", "jambonz-stats-collector": "^0.0.3", "moment": "^2.24.0", "parse-url": "^5.0.1",