Implement api.output, announcevoice command, a bunch of other tts shit, etc etc etc buh

This commit is contained in:
2021-04-07 01:33:47 +02:00
parent 0fd431d2bc
commit 158ed0372f
9 changed files with 61 additions and 10 deletions

View File

@@ -5,9 +5,17 @@ const querystring = require('querystring');
module.exports= class extends BaseEngine {
constructor() {
super("IBM Watson TTS","ogg");
this.voices={
'Michael': 'en-US_MichaelV3Voice',
'Allison': 'en-US_AllisonV3Voice',
'Kevin': 'en-US_KevinV3Voice',
};
}
async getSpeech(text, voice='en-us', params={}) {
const url = process.env.watsonURL+"/v1/synthesize";
getDefaultVoice() {
return 'Michael';
}
async getSpeech(text, voice=this.getSpeechVoice(), params={}) {
const url = process.env.watsonURL+"/v1/synthesize?voice="+this.getInternalVoiceName(voice);
let buff=new Buffer('apikey:'+process.env.watsonAPIKey);
let b64auth=buff.toString('base64');
const authorization='Basic '+b64auth;