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

处理讯飞api, on_close参数不匹配导致的报错问题 #195

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions autosub/api_xfyun.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def __call__(self, filename):
api_address=self.api_address),
on_message=lambda web_socket, msg: self.on_message(web_socket, msg),
on_error=lambda web_socket, msg: self.on_error(web_socket, msg),
on_close=lambda web_socket: self.on_close(web_socket),
on_close=self.on_close,
on_open=lambda web_socket: self.on_open(web_socket))
self.web_socket_app.run_forever(sslopt={"cert_reqs": ssl.CERT_NONE})
if self.is_full_result:
Expand Down Expand Up @@ -165,7 +165,7 @@ def on_error(self, web_socket, error): # pylint: disable=no-self-use
"""
raise exceptions.SpeechToTextException(error)

def on_close(self, web_socket): # pylint: disable=no-self-use, unused-argument
def on_close(self, *args): # pylint: disable=no-self-use, unused-argument
"""
Process the connection close from WebSocket.
"""
Expand Down Expand Up @@ -233,4 +233,4 @@ def run():
#
# print(web_socket_result_obj(filename=r".pcm"))
# time2 = datetime.now()
# print(time2 - time1)
# print(time2 - time1)