Fix formatting

This commit is contained in:
2021-04-07 01:36:35 +02:00
parent 158ed0372f
commit 12a9f8fc53
8 changed files with 78 additions and 78 deletions

View File

@@ -1,21 +1,21 @@
const fs=require('fs');
const fs = require('fs');
module.exports=class {
constructor(longName, fileExtension, supportedParameters=[]) {
this.longName=longName;
this.fileExtension=fileExtension;
module.exports = class {
constructor(longName, fileExtension, supportedParameters = []) {
this.longName = longName;
this.fileExtension = fileExtension;
}
getInternalVoiceName(str) {
return this.voices?this.voices[str]:str;
return this.voices ? this.voices[str] : str;
}
getDefaultVoice() {}
validateVoice(voice) {return this.voices ? this.voices[voice] : true;}
async getSpeech(text, voice=this.getDefaultVoice(), params) {}
getDefaultVoice() { }
validateVoice(voice) { return this.voices ? this.voices[voice] : true; }
async getSpeech(text, voice = this.getDefaultVoice(), 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);
const contents = await data.arrayBuffer();
const buf = Buffer.from(contents);
fs.writeFileSync(filepath, buf);
return filepath;
}
}