From 1a57b9fa5b5cc0a9e260e85062eb40d00d7980d3 Mon Sep 17 00:00:00 2001 From: IrvingGao <1729854488@qq.com> Date: Thu, 23 May 2024 20:05:05 +0800 Subject: [PATCH] [bug] board --- takway/clients/client_utils.py | 2 +- tools/easy_client.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/takway/clients/client_utils.py b/takway/clients/client_utils.py index 61c6a0a..f1b6066 100644 --- a/takway/clients/client_utils.py +++ b/takway/clients/client_utils.py @@ -176,7 +176,7 @@ class BaseWebSocketClient: #提取文本和二进制音频数据 text_bytes = recv_data[8:8 + text_length] audio = recv_data[8 + text_length:8 + text_length + audio_length] - text = text_bytes.decode('utf-8') + text = json.loads(text_bytes.decode('utf-8')) print("Received text:",text) #处理音频数据,例如播放音频 diff --git a/tools/easy_client.py b/tools/easy_client.py index 17c9a77..d656106 100644 --- a/tools/easy_client.py +++ b/tools/easy_client.py @@ -25,6 +25,7 @@ if __name__ == '__main__': try: response, data_type = client.receive_per_data() print(response[0], len(response[1])) + pritn(type(response[0]), type(response[1])) except: pass \ No newline at end of file