Skip to content

Commit 47372be

Browse files
committed
Add IAM Warning for STT Recognize
1 parent 2d57da0 commit 47372be

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • services/speech_to_text

services/speech_to_text/v1.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
module.exports = function (RED) {
1818
const SERVICE_IDENTIFIER = 'speech-to-text';
1919
var temp = require('temp'),
20+
request = require('request'),
2021
url = require('url'),
2122
fs = require('fs'),
2223
WebSocket = require('ws'),
@@ -298,6 +299,7 @@ module.exports = function (RED) {
298299
return tokenService;
299300
}
300301

302+
301303
function performSTT(speech_to_text, audioData) {
302304
var p = new Promise(function resolver(resolve, reject){
303305
var model = config.lang + '_' + config.band,
@@ -330,6 +332,7 @@ module.exports = function (RED) {
330332
resolve(res);
331333
}
332334
});
335+
333336
});
334337
return p;
335338
}
@@ -637,6 +640,9 @@ module.exports = function (RED) {
637640
if (config['streaming-mode']) {
638641
return performStreamSTT(sttService, audioData);
639642
} else {
643+
if (apikey) {
644+
node.warn('STT Speech Recognition may not work with API Key!');
645+
}
640646
return performSTT(sttService, audioData);
641647
}
642648
})

0 commit comments

Comments
 (0)