问题
Having some troubles with the service while pushing to Bluemix
The push request I am sending via php-curl is:
POST https://stream.watsonplatform.net/speech-to-text/api/v1/recognize
with the following parameters
model : en-US_NarrowbandModel
Content-Type : audio/wav; rate: 8000
Transfer-Encoding: chunked
timestamps : true
word_confidence : true
continuous : true
Response timeout is set to 2h (7200000 milliseconds)
We are getting timeout from curl for some of our files, without any apparent reason, at first I thought was related to the duration of the recordings, but I've got in logs with successful requests for audio files ~200 seconds long and timeouts for recordings 129 seconds.
I thought it may be a timeout problem or some errors in the audio file upload, so I started looking into the sessions but it is unclear to me how to the session process works and I cant sort it out in the documentation.
Following documentation (https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/speech-to-text/api/v1/)
I would be really glad if I can get some feedback / advise on what I am doing wrong...
Thanks...
回答1:
If the file that you are submitting is long then the REST interface may result in timeouts, even if you use sessions. In general, I recomend you to try the WebSockets interface to the Watson Speech To Text service. This interface is also a lot simpler than the REST interface with sessions, and you should not have any problem with timeouts. If your file contains very long silences please do not forget to set the inactivity_timeout parameter to a higher value, for example 600.
The documentation is here:
https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/speech-to-text/websockets.shtml
A simple working example in python is here:
https://github.com/watson-developer-cloud/speech-to-text-websockets-python
Dani
来源:https://stackoverflow.com/questions/32367299/watson-speech-to-text-response-times