forked from Talon/tardis-bot
Fix formatting
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
const BaseEngine=require('../BaseEngine');
|
||||
const BaseEngine = require('../BaseEngine');
|
||||
const fetch = require('node-fetch');
|
||||
const querystring = require('querystring');
|
||||
|
||||
module.exports= class extends BaseEngine {
|
||||
module.exports = class extends BaseEngine {
|
||||
constructor() {
|
||||
super("IBM Watson TTS","ogg");
|
||||
this.voices={
|
||||
super("IBM Watson TTS", "ogg");
|
||||
this.voices = {
|
||||
'Michael': 'en-US_MichaelV3Voice',
|
||||
'Allison': 'en-US_AllisonV3Voice',
|
||||
'Kevin': 'en-US_KevinV3Voice',
|
||||
@@ -14,12 +14,12 @@ module.exports= class extends BaseEngine {
|
||||
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;
|
||||
const opts={
|
||||
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;
|
||||
const opts = {
|
||||
method: "post",
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -29,6 +29,6 @@ module.exports= class extends BaseEngine {
|
||||
text: text
|
||||
})
|
||||
};
|
||||
return fetch(url,opts);
|
||||
return fetch(url, opts);
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user