Possibly added phonetic input to sam
This commit is contained in:
@@ -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());
|
||||
|
Reference in New Issue
Block a user