Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.
Python asraudiochineseemotion-recognitionfunasrmcp-servermultilingual-asropenai-compatible-apiparaformerpunctuationpytorchreal-time-asrspeaker-diarizationspeech-recognitionspeech-to-textstreaming-asrtranscriptionvllmvoice-activity-detectionwhisper-alternative
export
游雁63bcaf7093c9
diff --git a/funasr/runtime/python/websocket/ASR_client.py b/funasr/runtime/python/websocket/ASR_client.pyindex fe6798127..d1fb93a93 100644--- a/funasr/runtime/python/websocket/ASR_client.py+++ b/funasr/runtime/python/websocket/ASR_client.py@@ -6,6 +6,7 @@ import asynciofrom queue import Queue# import threadingimport argparse+import jsonparser = argparse.ArgumentParser()parser.add_argument("--host",@@ -78,7 +79,9 @@ async def message():global websocketwhile True:try:- print(await websocket.recv())+ meg = await websocket.recv()+ meg = json.loads(meg)+ print(meg)except Exception as e:print("Exception:", e)diff --git a/funasr/runtime/python/websocket/ASR_server.py b/funasr/runtime/python/websocket/ASR_server.pyindex 827df7b58..c717e7126 100644--- a/funasr/runtime/python/websocket/ASR_server.py+++ b/funasr/runtime/python/websocket/ASR_server.py@@ -4,6 +4,7 @@ import timefrom queue import Queueimport threadingimport argparse+import jsonfrom modelscope.pipelines import pipelinefrom modelscope.utils.constant import Tasks@@ -157,7 +158,8 @@ def asr(websocket): # ASR推理rec_result = inference_pipeline_punc(text_in=rec_result['text'], param_dict=websocket.param_dict_punc)# print(rec_result)if "text" in rec_result:- websocket.send_msg.put(rec_result["text"]) # 存入发送队列 直接调用send发送不了+ message = json.dumps({"mode": "offline", "text": rec_result["text"]})+ websocket.send_msg.put(message) # 存入发送队列 直接调用send发送不了time.sleep(0.1)