Closed Nhor closed 8 years ago
hi @Nhor, did you update the <username>
and <password>
fields before running the example?
(Note: both the username and password are random characters generated by bluemix - see https://github.com/watson-developer-cloud/node-sdk#getting-the-service-credentials for instructions on how to get them.)
Yes, I've generated my Watson Speech To Text service credentials and I'm getting the very first chunk of the response, but there goes a cascade of errors. Here's the console.log
output:
2016-01-12 19:42:34.299: so it's who makes her home and you know I have a date when you gonna do
2016-01-12 19:42:34.311: Error: write after end
2016-01-12 19:42:34.311: Error: write after end
2016-01-12 19:42:34.311: Error: write after end
2016-01-12 19:42:34.327: Error: write after end
2016-01-12 19:42:34.327: Error: write after end
2016-01-12 19:42:34.327: Error: write after end
Hum, that doesn't sound good.. can you email me the sample audio file you're using? [github username]@us.ibm.com
Oh, also, please try creating a reference to the recognizeStream and listening for other events to see if anything else stands out. There's an example of this at https://github.com/watson-developer-cloud/node-sdk/blob/master/examples/speech_to_text.v1.js
I've tried several audio files. So my conclusion is that it seems like the service is working perfectly fine with short phrases but fails to recognize bigger files, throwing Error: write after end
exception for each next chunk after the first one.
Got the file, reproduced the bug, it looks like the connection is closing with a 1006 error/status code. I'll track down the root cause and get a fix out, hopefully within a day or two.
Great, thanks!
This should be fixed in v1.2.0 - by default, the STT services stops processing after the first sentence/pause, and there's a continuous
flag to override this. Node.js streams, though, has their own mechanism for ending the connection so I changed the default value to true
(meaning keep transcribing until the audio stops coming) and also made it overrideable.
There may still be some issues to be address when it is overridden and set to false, but this should be a better fit for most usage.
Code from the docs:
throws
Error: write after end
exception. Here's my full stacktrace: