watson-developer-cloud / speech-to-text-websockets-python

Python client that interacts with the IBM Watson Speech To Text service through its WebSockets interface
http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/speech-to-text.html
86 stars 63 forks source link

Issue regarding Session Timed out #26

Closed Priya997 closed 6 years ago

Priya997 commented 6 years ago

The library is awesome and is helping me a lot but I need help with this issue other audio files have proper transcription and working perfectly but some of my audio files have silence in it in between and I think because of that I run into session timed out. Is there any solution to solve this? I tried changing Inactivity_timeout=-1 but it is of no use,

2018-08-22 04:06:05-0700 [-] Log opened. 2018-08-22 04:06:05-0700 [-] ./recordings/UXArmy_record.wav 2018-08-22 04:06:05-0700 [-] 2018-08-22 04:06:05-0700 [-] {'Authorization': 'Basic ZjIzNmUwOTAtYTIwNC00MzEyLTg5ZDktZGIwMGM1ZmFjNjk2OnQxZWtITHlTVDhjWg=='} 2018-08-22 04:06:05-0700 [-] wss://stream.watsonplatform.net/speech-to-text/api/v1/recognize?model=en-US_BroadbandModel 2018-08-22 04:06:05-0700 [-] Starting factory <main.WSInterfaceFactory object at 0x7f8b77c92c10> 2018-08-22 04:06:06-0700 [-] ./output 2018-08-22 04:06:06-0700 [-] contentType: audio/wav queueSize: 1 2018-08-22 04:06:09-0700 [-] onConnect, server connected: tcp4:169.48.115.62:443 2018-08-22 04:06:09-0700 [-] onOpen 2018-08-22 04:06:09-0700 [-] sendMessage(init) 2018-08-22 04:06:09-0700 [-] ./recordings/UXArmy_record.wav 2018-08-22 04:06:10-0700 [-] onOpen ends 2018-08-22 04:06:16-0700 [-] Text message received: { 2018-08-22 04:06:16-0700 [-] "state": "listening" 2018-08-22 04:06:16-0700 [-] } 2018-08-22 04:06:44-0700 [-] Text message received: { 2018-08-22 04:06:44-0700 [-] "error": "Session timed out." 2018-08-22 04:06:44-0700 [-] } 2018-08-22 04:09:49-0700 [-] onClose 2018-08-22 04:09:49-0700 [-] WebSocket connection closed: see the previous message for the error details., code: 1011, clean: True, reason: see the previous message for the error details. 2018-08-22 04:09:49-0700 [-] ./output 2018-08-22 04:09:49-0700 [-] contentType: audio/wav queueSize: 0 2018-08-22 04:09:50-0700 [-] onConnect, server connected: tcp4:169.48.115.62:443 2018-08-22 04:09:50-0700 [-] onOpen 2018-08-22 04:09:50-0700 [-] sendMessage(init) `

germanattanasio commented 6 years ago

@Priya997 We are not maintaining this repository anymore. Did you try using the python-sdk?

There is an example for WebSockets https://github.com/watson-developer-cloud/python-sdk/blob/master/examples/speech_to_text_v1.py

Priya997 commented 6 years ago

@germanattanasio I tried that as well. Same issue.. It would be great if you can guide me why am getting this error or how to resolve this.

germanattanasio commented 6 years ago

Did you open an issue in the python-sdk? If you provide us with a set of steps that we can use to reproduce the issue then we can look at it

Priya997 commented 6 years ago

No, I haven't opened the issue in python-sdk. I can send you the audio file by running that audio file the issue is generated automatically Here, is the audio try this you will get that error. https://drive.google.com/file/d/1Y_1Oj2LkvdXxlj99_dhIcQwmwRlj3lMY/view?usp=sharing

Priya997 commented 6 years ago

Thanks, I resolved the issue... So, am closing it. :D