diff --git a/takway/clients/web_socket_client_utils.py b/takway/clients/web_socket_client_utils.py index b466b61..8515023 100644 --- a/takway/clients/web_socket_client_utils.py +++ b/takway/clients/web_socket_client_utils.py @@ -187,8 +187,8 @@ class WebSocketClinet: print(f"{datetime.now()}: Wake up by button.") else: if recorder.is_wakeup(data): - self.wakeup_event.set() recorder.hardware.long_power_status = True + self.wakeup_event.set() print(f"{datetime.now()}: wake up by voice.") else: continue @@ -233,7 +233,7 @@ class WebSocketClinet: # 长时沉默关闭唤醒状态:如果唤醒后超过一定时间没有说话/关闭按键被按下,则认为是结束 if slience_time > recorder.max_slience_time: recorder.hardware.long_power_status = False - self.wakeup_event.set() + self.wakeup_event.clear() break # 短时沉默结束单次对话:沉默时间超过一定时间段(0.5s左右),则发送数据