Skip to content

Commit fc30ffa

Browse files
committed
Make STT more verbose in Stream mode
1 parent e1e283a commit fc30ffa

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Node-RED Watson Nodes for IBM Cloud
77

88
<a href="https://cla-assistant.io/watson-developer-cloud/node-red-node-watson"><img src="https://cla-assistant.io/readme/badge/watson-developer-cloud/node-red-node-watson" alt="CLA assistant" /></a>
99

10+
### New in version 0.6.4
11+
- Speech to Text node now reports all errors, including disconnects when running in stream mode.
12+
1013
### New in version 0.6.3
1114
- Allow input / output from Node-RED web-sockets for Speech to Text node. To
1215
enable select streaming mode. No token is needed as the Node handles this. Look

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-node-watson",
3-
"version": "0.6.3",
3+
"version": "0.6.4",
44
"description": "A collection of Node-RED nodes for IBM Watson services",
55
"dependencies": {
66
"async": "^1.5.2",

services/speech_to_text/v1.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,18 +391,22 @@ module.exports = function (RED) {
391391
// console.log('Data Received from Input');
392392
// console.log(data);
393393
var d = JSON.parse(data);
394-
var newMsg = {payload : JSON.parse(data)};
394+
var newMsg = {payload : JSON.parse(data)};
395395
if (d) {
396396
if (d.error) {
397397
// Force Expiry of Token, as that is the only Error
398398
// response from the service that we have seen.
399+
// report the error for verbose testing
400+
payloadutils.reportError(node,newMsg,e.error);
399401
token = null;
400402
getToken(determineService())
401403
.then(() => {
402404
return;
403405
});
404406
} else if (d && d.state && 'listening' === d.state) {
405407
socketListening = true;
408+
// Added for verbose testing
409+
node.send(newMsg);
406410
//resolve();
407411
} else {
408412
node.send(newMsg);

services/text_to_speech/v1.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ module.exports = function(RED) {
139139
}
140140

141141
text_to_speech = new TextToSpeechV1(serviceSettings);
142+
console.log('------------');
143+
console.log('Running TTS with params ', params);
142144
text_to_speech.synthesize(params, function (err, body, response) {
143145
if (err) {
144146
reject(err);

0 commit comments

Comments
 (0)