[bug] board

This commit is contained in:
IrvingGao 2024-05-23 17:25:22 +08:00
parent 7fe7a02777
commit 03304eda02
1 changed files with 5 additions and 5 deletions

View File

@ -144,8 +144,7 @@ class WebSocketClinet:
while True: while True:
# 开关按键被按下 # 开关按键被按下
if recorder.hardware.long_power_status: if recorder.hardware.long_power_status:
if not self.wakeup_event.is_set(): self.wakeup_event.set()
self.wakeup_event.set()
# 短时按键被按下,打断 # 短时按键被按下,打断
try: try:
if recorder.hardware.short_power_status and not last_short_power_status: if recorder.hardware.short_power_status and not last_short_power_status:
@ -317,7 +316,6 @@ class WebSocketClinet:
while True: while True:
if self.client_queue.empty(): if self.client_queue.empty():
continue continue
print(f"web socket: {self.wakeup_event.is_set()}, {self.interrupt_event.is_set()}, {self.listening_event.is_set()}")
print(f"{datetime.now()}: start setup web socket connection.") print(f"{datetime.now()}: start setup web socket connection.")
# 第一级:唤醒状态下,连接服务器 # 第一级:唤醒状态下,连接服务器
@ -452,8 +450,10 @@ class WebSocketClinet:
print(f"audio play error: {e}") print(f"audio play error: {e}")
continue continue
# 启动监听状态 if self.wakeup_event.is_set():
self.listening_event.set() # 启动监听状态
self.speaking_event.clear()
self.listening_event.set()