From 7557fa87a8043867e39f4920b38d6163d54095ef Mon Sep 17 00:00:00 2001
From: zhifu gao <zhifu.gzf@alibaba-inc.com>
Date: 星期一, 08 五月 2023 00:13:59 +0800
Subject: [PATCH] Merge pull request #468 from alibaba-damo-academy/dev_websocket_offline
---
funasr/runtime/python/websocket/ws_server_offline.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/funasr/runtime/python/websocket/ws_server_offline.py b/funasr/runtime/python/websocket/ws_server_offline.py
index 7873918..c60ea6f 100644
--- a/funasr/runtime/python/websocket/ws_server_offline.py
+++ b/funasr/runtime/python/websocket/ws_server_offline.py
@@ -78,6 +78,7 @@
is_speaking = message["is_speaking"]
websocket.param_dict_vad["is_final"] = not is_speaking
+ websocket.wav_name = message.get("wav_name", "demo")
if speech_start:
frames_asr.append(audio)
speech_start_i, speech_end_i = await async_vad(websocket, audio)
@@ -136,8 +137,9 @@
rec_result = inference_pipeline_punc(text_in=rec_result['text'],
param_dict=websocket.param_dict_punc)
# print(rec_result)
- message = json.dumps({"mode": "offline", "text": [rec_result["text"]]})
- await websocket.send(message)
+ message = json.dumps({"mode": "offline", "text": [rec_result["text"]], "wav_name": websocket.wav_name})
+ await websocket.send(message)
+
--
Gitblit v1.9.1