From 82d5cbc758141cdae2bcd0403c6896e708b14ac6 Mon Sep 17 00:00:00 2001 From: guilevi Date: Sun, 4 Jul 2021 01:06:42 +0200 Subject: [PATCH] Possibly added phonetic input to sam --- tts/sam/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tts/sam/index.js b/tts/sam/index.js index ce9cc77..1672963 100644 --- a/tts/sam/index.js +++ b/tts/sam/index.js @@ -12,7 +12,12 @@ module.exports = class extends BaseEngine { } async getSpeechFile(text, filepath, voice = this.getDefaultVoice(), params = {}) { let sam = new Sam(); - const buf = sam.buf8(text); + let phonetic = false; + if (text[0] == "$") { + text = text.slice(1); + phonetic = true; + } + const buf = sam.buf8(text, phonetic); const file = new wavefile.WaveFile(); file.fromScratch(1, 22050, 8, buf); fs.writeFileSync(filepath, file.toBuffer());