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

13
tts/gtranslate/index.js Normal file
View File

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