[bug] board

This commit is contained in:
IrvingGao 2024-05-23 20:09:52 +08:00
parent 10b5671726
commit b564941a3f
1 changed files with 7 additions and 2 deletions

View File

@ -480,10 +480,15 @@ class WebSocketClinet:
except TypeError as e: except TypeError as e:
print(f"audio play error: {e}") print(f"audio play error: {e}")
continue continue
elif item[0] == 'audio_json':
print(f"data_type: {data_type}") print(f"data_type: {data_type}")
if self.wakeup_event.is_set(): 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.speaking_event.clear()
self.listening_event.set() self.listening_event.set()