This commit is contained in:
2021-04-06 02:16:09 +02:00
parent b444508fb8
commit 110b78c762
11 changed files with 88 additions and 22 deletions

16
tts/BaseEngine/index.js Normal file
View File

@@ -0,0 +1,16 @@
const fs=require('fs');
module.exports=class {
constructor(longName, fileExtension, supportedParameters=[]) {
this.longName=longName;
this.fileExtension=fileExtension;
}
async getSpeech(text, voice, params) {}
async getSpeechFile(text, filepath, voice, params) {
const data = await this.getSpeech(text, voice, params);
const contents = await data.arrayBuffer();
const buf = Buffer.from(contents);
fs.writeFileSync(filepath, buf);
return filepath;
}
}