16 lines
488 B
JavaScript
16 lines
488 B
JavaScript
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;
|
|
}
|
|
} |