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,16 +1,16 @@
const BaseEngine=require('../BaseEngine');
const BaseEngine = require('../BaseEngine');
const fetch = require('node-fetch');
const tts = require('google-tts-api');
module.exports= class extends BaseEngine {
module.exports = class extends BaseEngine {
constructor() {
super("Google Translate TTS","mp3");
super("Google Translate TTS", "mp3");
}
getDefaultVoice() {
return 'en-us';
}
async getSpeech(text, voice=this.getDefaultVoice(), params={}) {
const url = tts.getAudioUrl(text, {lang: voice});
async getSpeech(text, voice = this.getDefaultVoice(), params = {}) {
const url = tts.getAudioUrl(text, { lang: voice });
return fetch(url);
}
};