Skip to content

Commit 61ccc82

Browse files
committed
Migrate to ibm-watson dependancy
1 parent 5346fe3 commit 61ccc82

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

services/text_to_speech/v1-corpus-builder.js

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -316,13 +316,12 @@ module.exports = function (RED) {
316316
}
317317
if ('custom' === config['tts-voice-or-custom']) {
318318
if (config['tts-custom-id']) {
319-
params['customization_id'] = config['tts-custom-id'];
319+
params['customizationId'] = config['tts-custom-id'];
320320
}
321321
} else if ( config['tts-voice'] ) {
322322
params['voice'] = config['tts-voice'];
323323
}
324324

325-
console.log('Params will be :', params);
326325
return params;
327326
}
328327

@@ -390,7 +389,7 @@ module.exports = function (RED) {
390389
RED.nodes.createNode(this, config);
391390
var node = this;
392391

393-
this.on('input', function(msg) {
392+
this.on('input', function(msg, send, done) {
394393
var method = config['tts-custom-mode'],
395394
message = '',
396395
params = {};
@@ -417,16 +416,6 @@ module.exports = function (RED) {
417416
return;
418417
}
419418

420-
421-
//if (checkForFile(method)) {
422-
// if (msg.payload instanceof Buffer) {
423-
// console.log('Processing as a Buffer');
424-
// loadFile(node, method, params, msg);
425-
// return;
426-
// }
427-
// params = setFileParams(method, params, msg);
428-
//}
429-
430419
checkForFile(method)
431420
.then((lookForBuffer) => {
432421
if (msg.payload instanceof Buffer) {
@@ -442,15 +431,15 @@ module.exports = function (RED) {
442431
})
443432
.then(() => {
444433
node.status({});
445-
node.send(msg);
434+
send(msg);
446435
temp.cleanup();
447-
console.log('Method ran to completion');
436+
done();
448437
})
449438
.catch((err) => {
450439
node.status({});
451440
payloadutils.reportError(node, msg, err);
452441
temp.cleanup();
453-
console.log('Method failed');
442+
done(err);
454443
})
455444
});
456445
}

0 commit comments

Comments
 (0)