Skip to content

Commit

Permalink
Fixed indents
Browse files Browse the repository at this point in the history
  • Loading branch information
chughts committed Sep 1, 2016
1 parent cc98ad4 commit f639ac2
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions services/text_to_speech/v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,25 @@ module.exports = function(RED) {
});

// API used by widget to fetch available models
RED.httpAdmin.get('/watson-text-to-speech/voices', function (req, res) {
var tts = watson.text_to_speech({
username: sUsername ? sUsername : req.query.un,
password: sPassword ? sPassword : req.query.pwd,
version: 'v1',
url: 'https://stream.watsonplatform.net/text-to-speech/api'
});

tts.voices({}, function(err, voices){
if (err) {
if (!err.error) {
err.error = 'Error ' + err.code + ' in fetching voices';
}
res.json(err);
} else {
res.json(voices);
}
});
});


RED.httpAdmin.get('/watson-text-to-speech/voices', function (req, res) {
var tts = watson.text_to_speech({
username: sUsername ? sUsername : req.query.un,
password: sPassword ? sPassword : req.query.pwd,
version: 'v1',
url: 'https://stream.watsonplatform.net/text-to-speech/api'
});

tts.voices({}, function(err, voices){
if (err) {
if (!err.error) {
err.error = 'Error ' + err.code + ' in fetching voices';
}
res.json(err);
} else {
res.json(voices);
}
});
});

function Node(config) {
RED.nodes.createNode(this, config);
Expand All @@ -77,7 +75,7 @@ module.exports = function(RED) {
}

username = sUsername || this.credentials.username;
password = sPassword || this.credentials.password || config.password; ;
password = sPassword || this.credentials.password || config.password;

if (!username || !password) {
var message = 'Missing Speech To Text service credentials';
Expand Down

0 comments on commit f639ac2

Please sign in to comment.