Commit 0ae2b75 1 parent ca596f2 commit 0ae2b75 Copy full SHA for 0ae2b75
File tree 2 files changed +11
-22
lines changed
2 files changed +11
-22
lines changed Original file line number Diff line number Diff line change 16
16
17
17
module . exports = function ( RED ) {
18
18
const SERVICE_IDENTIFIER = 'speech-to-text' ;
19
- var request = require ( 'request' ) ;
20
- var cfenv = require ( 'cfenv' ) ;
21
- var temp = require ( 'temp' ) ;
22
- var url = require ( 'url' ) ;
23
- var fs = require ( 'fs' ) ;
24
- var fileType = require ( 'file-type' ) ;
25
- //var watson = require('watson-developer-cloud');
26
- var serviceutils = require ( '../../utilities/service-utils' ) ;
27
-
28
- var sttV1 = require ( 'watson-developer-cloud/speech-to-text/v1' ) ;
29
-
30
- //var service = cfenv.getAppEnv().getServiceCreds(/speech to text/i);
31
- var service = serviceutils . getServiceCreds ( SERVICE_IDENTIFIER ) ;
19
+ var request = require ( 'request' ) ,
20
+ cfenv = require ( 'cfenv' ) ,
21
+ temp = require ( 'temp' ) ,
22
+ url = require ( 'url' ) ,
23
+ fs = require ( 'fs' ) ,
24
+ fileType = require ( 'file-type' ) ,
25
+ serviceutils = require ( '../../utilities/service-utils' ) ,
26
+ sttV1 = require ( 'watson-developer-cloud/speech-to-text/v1' ) ,
27
+ service = serviceutils . getServiceCreds ( SERVICE_IDENTIFIER ) ;
32
28
33
29
// Require the Cloud Foundry Module to pull credentials from bound service
34
30
// If they are found then the username and password will be stored in
Original file line number Diff line number Diff line change 17
17
module . exports = function ( RED ) {
18
18
const SERVICE_IDENTIFIER = 'text-to-speech' ;
19
19
var cfenv = require ( 'cfenv' ) ;
20
- //var watson = require('watson-developer-cloud');
21
20
var TextToSpeechV1 = require ( 'watson-developer-cloud/text-to-speech/v1' ) ;
22
21
var serviceutils = require ( '../../utilities/service-utils' ) ;
23
22
@@ -48,12 +47,9 @@ module.exports = function(RED) {
48
47
49
48
// API used by widget to fetch available models
50
49
RED . httpAdmin . get ( '/watson-text-to-speech/voices' , function ( req , res ) {
51
- //var tts = watson.text_to_speech({
52
50
var tts = new TextToSpeechV1 ( {
53
51
username : sUsername ? sUsername : req . query . un ,
54
- password : sPassword ? sPassword : req . query . pwd //,
55
- //version: 'v1',
56
- //url: 'https://stream.watsonplatform.net/text-to-speech/api'
52
+ password : sPassword ? sPassword : req . query . pwd
57
53
} ) ;
58
54
59
55
tts . voices ( { } , function ( err , voices ) {
@@ -88,12 +84,9 @@ module.exports = function(RED) {
88
84
return ;
89
85
}
90
86
91
- //var text_to_speech = watson.text_to_speech({
92
87
var text_to_speech = new TextToSpeechV1 ( {
93
88
username : username ,
94
- password : password //,
95
- //version: 'v1',
96
- //url: 'https://stream.watsonplatform.net/text-to-speech/api'
89
+ password : password
97
90
} ) ;
98
91
99
92
var params = {
You can’t perform that action at this time.
0 commit comments