From ee88a48fa58fb881c4f5a012a74503baeba7592c Mon Sep 17 00:00:00 2001 From: Talon Date: Sat, 3 Jul 2021 22:51:19 +0200 Subject: [PATCH] Fixed crash with announcer --- modules/announcer/index.js | 3 ++- package-lock.json | 1 + tts/sam/index.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/announcer/index.js b/modules/announcer/index.js index d62658e..b1746f1 100644 --- a/modules/announcer/index.js +++ b/modules/announcer/index.js @@ -25,7 +25,8 @@ module.exports = function (bot, api) { } else { str = printf(api.strings.USER_JOINED, username); } + const filepath = await api.generateVoice(str, api.announcementEngine, api.announcementVoice); api.queue.add(__dirname + "/sysmsg.wav"); - api.queue.add(channel, str); + api.queue.add(filepath); }) } diff --git a/package-lock.json b/package-lock.json index 4dccff7..406b8cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1895,6 +1895,7 @@ "hasInstallScript": true, "dependencies": { "node-addon-api": "^3.0.0", + "node-gyp": "3.x", "node-pre-gyp": "^0.11.0" }, "optionalDependencies": { diff --git a/tts/sam/index.js b/tts/sam/index.js index dd56658..ce9cc77 100644 --- a/tts/sam/index.js +++ b/tts/sam/index.js @@ -8,7 +8,7 @@ module.exports = class extends BaseEngine { super('sam', 'Software Automatic Mouth', 'wav') } getDefaultVoice() { - return 'en'; + return 'sam'; } async getSpeechFile(text, filepath, voice = this.getDefaultVoice(), params = {}) { let sam = new Sam();