Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on_close() takes 1 positional argument but 3 were given #4

Open
xiaomujiang opened this issue Aug 7, 2022 · 3 comments
Open

on_close() takes 1 positional argument but 3 were given #4

xiaomujiang opened this issue Aug 7, 2022 · 3 comments

Comments

@xiaomujiang
Copy link

使用python文件,调用语音识别报错
2022-08-07 17:48:53,435 - websocket-ERROR error from callback <function on_close at 0x00000219AB75CB80>: on_close() takes 1 positional argument but 3 were given
2022-08-07 17:48:53,435 - root-ERROR error: on_close() takes 1 positional argument but 3 were given

@xiaomujiang
Copy link
Author

情节用的mic声音, 还出现了 - root-INFO Response: {"err_no":-3101,"err_msg":"wait audio over time","log_id":2082350563,"type":"FIN_TEXT"}

@Gandalfwechat
Copy link

这个错误和版本无关,on_close() 函数需要 同时传入 websocket 的 obj,状态码,以及关闭消息,
改成:def on_close(ws, status_code, close_msg): 就不报错了。

@my369369
Copy link

my369369 commented Apr 3, 2024

按照这个方法改了,但现在报错提示为ERROR - [onError] [webSocket Error事件]

这个错误和版本无关,on_close() 函数需要 同时传入 websocket 的 obj,状态码,以及关闭消息, 改成:def on_close(ws, status_code, close_msg): 就不报错了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants