const BaseEngine = require('../BaseEngine'); const fetch = require('node-fetch'); const tts = require('google-tts-api'); module.exports = class extends BaseEngine { constructor() { super('gtranslate', "Google Translate TTS", "mp3"); } getDefaultVoice() { return 'en-us'; } async getSpeech(text, voice = this.getDefaultVoice(), params = {}) { const url = tts.getAudioUrl(text, { lang: voice }); return fetch(url); } };