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());