weixin_39613433
weixin_39613433
2020-12-06 12:31

Session timed out

The audio file should be transcribed completely but sometimes in the middle of the transcription or at the end, I got an error Error received: Session timed out.

Steps to reproduce the problem

The problem can be reproduced using this audio file: https://drive.google.com/file/d/1Y_1Oj2LkvdXxlj99_dhIcQwmwRlj3lMY/view?usp=sharing

Code snippet (Note: Do not paste your credentials)

The code is the same as in here https://github.com/watson-developer-cloud/python-sdk/blob/master/examples/speech_to_text_v1.py The only change I made is:

py
speech_to_text.recognize(
                continuous=True,
                audio=audio_file,
                content_type='audio/wav',
                Transfer_Encoding='chunked',
                timestamps=True,
                word_confidence=True,
                inactivity_timeout='-1'),
            indent=2))

python sdk version

watson-developer-cloud==1.7.0

python version

Python 3.6.5

该提问来源于开源项目:watson-developer-cloud/python-sdk

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

4条回答

  • weixin_39835792 weixin_39835792 5月前

    Hi,

    Did you try using the recognize_using_websockets method instead?

    点赞 评论 复制链接分享
  • weixin_39613433 weixin_39613433 5月前

    Hey, yes I have tried that also. But same issue am facing.

    点赞 评论 复制链接分享
  • weixin_39835792 weixin_39835792 5月前

    ,

    which version of sdk are you using? The parameters that you pass are in a very old release.

    Also, we are coming with a new major release having a new websocket library.

    点赞 评论 复制链接分享
  • weixin_39613433 weixin_39613433 5月前

    Thanks, I resolved the issue :D

    点赞 评论 复制链接分享

相关推荐