Possibly added phonetic input to sam
parent
ee88a48fa5
commit
82d5cbc758
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue