From b564941a3f43302d18999bc2dcb1cae858c1bdb8 Mon Sep 17 00:00:00 2001 From: IrvingGao <1729854488@qq.com> Date: Thu, 23 May 2024 20:09:52 +0800 Subject: [PATCH] [bug] board --- takway/clients/web_socket_client_utils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/takway/clients/web_socket_client_utils.py b/takway/clients/web_socket_client_utils.py index 10730d0..bcf722a 100644 --- a/takway/clients/web_socket_client_utils.py +++ b/takway/clients/web_socket_client_utils.py @@ -480,10 +480,15 @@ class WebSocketClinet: except TypeError as e: print(f"audio play error: {e}") continue - + + elif item[0] == 'audio_json': print(f"data_type: {data_type}") if self.wakeup_event.is_set(): - if data_type == 'end': + if data_type == 'text': + # 切换播放模式 + self.listening_event.clear() + self.speaking_event.set() + if data_type in ['close', 'end']: # 启动监听状态 self.speaking_event.clear() self.listening_event.set()