Skip to content
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)