游雁
2023-07-13 7314f0795c47f09d3ccc0ed81dc4a51a483b64f6
websocket bug
2个文件已修改
1个文件已删除
7 ■■■■ 已修改文件
funasr/runtime/html5/demo.gif 补丁 | 查看 | 原始文档 | blame | 历史
funasr/runtime/python/websocket/funasr_wss_client.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/runtime/python/websocket/funasr_wss_server.py 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/runtime/html5/demo.gif
Binary files differ
funasr/runtime/python/websocket/funasr_wss_client.py
@@ -204,6 +204,7 @@
        
            meg = await websocket.recv()
            meg = json.loads(meg)
            print(meg)
            wav_name = meg.get("wav_name", "demo")
            text = meg["text"]
funasr/runtime/python/websocket/funasr_wss_server.py
@@ -240,7 +240,8 @@
                                                         param_dict=websocket.param_dict_punc)
                    # print("offline", rec_result)
                if 'text' in rec_result:
                    message = json.dumps({"mode": websocket.mode, "text": rec_result["text"], "wav_name": websocket.wav_name})
                    mode = "2pass-offline" if "2pass" in websocket.mode else websocket.mode
                    message = json.dumps({"mode": mode, "text": rec_result["text"], "wav_name": websocket.wav_name})
                    await websocket.send(message)
@@ -256,7 +257,8 @@
        if "text" in rec_result:
            if rec_result["text"] != "sil" and rec_result["text"] != "waiting_for_more_voice":
                # print("online", rec_result)
                message = json.dumps({"mode": websocket.mode, "text": rec_result["text"], "wav_name": websocket.wav_name})
                mode = "2pass-online" if "2pass" in websocket.mode else websocket.mode
                message = json.dumps({"mode": mode, "text": rec_result["text"], "wav_name": websocket.wav_name})
                await websocket.send(message)
if len(args.certfile)>0: