From 8c28f934c84c1c95e2800a0f274885953e5601fc Mon Sep 17 00:00:00 2001 From: martsforever Date: Sun, 2 Nov 2025 17:24:45 +0800 Subject: [PATCH] feat: rename variable --- app/controller/add_websocket_voice_recognise_route.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controller/add_websocket_voice_recognise_route.py b/app/controller/add_websocket_voice_recognise_route.py index 56990e4..e956094 100644 --- a/app/controller/add_websocket_voice_recognise_route.py +++ b/app/controller/add_websocket_voice_recognise_route.py @@ -58,7 +58,7 @@ def add_websocket_voice_recognise_route(app: FastAPI): await bailian_socket.send(json.dumps(session_event)) # 创建双向转发任务 - async def forward_to_bailing(): + async def waiting_msg_from_front(): """将前端PCM数据转发到百炼""" try: while True: @@ -85,7 +85,7 @@ def add_websocket_voice_recognise_route(app: FastAPI): except Exception as e: print(f"等待前端的消息出错: {e}") - async def forward_to_client(): + async def waiting_msg_from_bailian(): """将百炼识别结果转发到客户端""" try: async for message in bailian_socket: @@ -110,8 +110,8 @@ def add_websocket_voice_recognise_route(app: FastAPI): # 并发运行两个任务 await asyncio.gather( - forward_to_bailing(), - forward_to_client(), + waiting_msg_from_front(), + waiting_msg_from_bailian(), return_exceptions=True )