websocket 2pass bugfix

This commit is contained in:
游雁 2023-05-19 11:33:27 +08:00
parent 7eaf608c2d
commit 219c2482ab

View File

@ -170,8 +170,9 @@ async def async_asr(websocket, audio_in):
rec_result = inference_pipeline_punc(text_in=rec_result['text'],
param_dict=websocket.param_dict_punc)
# print("offline", rec_result)
message = json.dumps({"mode": "2pass-offline", "text": rec_result["text"], "wav_name": websocket.wav_name})
await websocket.send(message)
if 'text' in rec_result:
message = json.dumps({"mode": "2pass-offline", "text": rec_result["text"], "wav_name": websocket.wav_name})
await websocket.send(message)
async def async_asr_online(websocket, audio_in):