mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
author:yijinsheng wss_client_fix
This commit is contained in:
parent
b0b796f9a4
commit
3c2d793370
@ -256,6 +256,7 @@ async def message(id):
|
|||||||
wav_name = meg.get("wav_name", "demo")
|
wav_name = meg.get("wav_name", "demo")
|
||||||
text = meg["text"]
|
text = meg["text"]
|
||||||
timestamp=""
|
timestamp=""
|
||||||
|
offline_msg_done = meg.get("is_final", False)
|
||||||
if "timestamp" in meg:
|
if "timestamp" in meg:
|
||||||
timestamp = meg["timestamp"]
|
timestamp = meg["timestamp"]
|
||||||
|
|
||||||
@ -265,7 +266,9 @@ async def message(id):
|
|||||||
else:
|
else:
|
||||||
text_write_line = "{}\t{}\n".format(wav_name, text)
|
text_write_line = "{}\t{}\n".format(wav_name, text)
|
||||||
ibest_writer.write(text_write_line)
|
ibest_writer.write(text_write_line)
|
||||||
|
|
||||||
|
if 'mode' not in meg:
|
||||||
|
continue
|
||||||
if meg["mode"] == "online":
|
if meg["mode"] == "online":
|
||||||
text_print += "{}".format(text)
|
text_print += "{}".format(text)
|
||||||
text_print = text_print[-args.words_max_print:]
|
text_print = text_print[-args.words_max_print:]
|
||||||
@ -292,7 +295,7 @@ async def message(id):
|
|||||||
text_print = text_print[-args.words_max_print:]
|
text_print = text_print[-args.words_max_print:]
|
||||||
os.system('clear')
|
os.system('clear')
|
||||||
print("\rpid" + str(id) + ": " + text_print)
|
print("\rpid" + str(id) + ": " + text_print)
|
||||||
offline_msg_done=True
|
# offline_msg_done=True
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("Exception:", e)
|
print("Exception:", e)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user