From bb409352421de6ceb93cfe271e5a82dee6740365 Mon Sep 17 00:00:00 2001 From: dxy <1731678236qq.com> Date: Tue, 2 Sep 2025 16:22:48 +0800 Subject: [PATCH] =?utf8?q?=E6=8C=89=E9=94=AE=E9=9F=B3=E9=87=8D=E5=A4=8D?= =?utf8?q?=E6=92=AD=E6=94=BE=E7=9A=84=E9=97=AE=E9=A2=98=20=E4=BE=A7?= =?utf8?q?=E9=94=AE=E6=89=93=E6=96=AD=20=E6=8C=89AI=E9=94=AE=E7=AC=AC?= =?utf8?q?=E4=B8=80=E6=AC=A1=E6=B2=A1=E6=9C=89=E6=8C=89=E9=94=AE=E9=9F=B3?= =?utf8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../microPython/ports/quectel/core/ai_VC.py | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/ai_VC.py b/2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/ai_VC.py index 5f782042..1e93caf5 100644 --- a/2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/ai_VC.py +++ b/2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/ai_VC.py @@ -1274,6 +1274,12 @@ class AI_dev(Abstract): if dev_type == "7PIN_BK"or dev_type == "7PIN_BK_EU"or dev_type == "7PIN_BK_coze": key_count = 3 if self.KeyAI_timer_count >= key_count: #防抖200ms + if self.KeySOS_timer_flag == 1: + self.KeySOS_timer_flag = 0 + self.KeySos_long_press = 0 + self.KeySOS_timer.stop() + print("KeySOS_timer_flag!!!!!!!!!!!!!!!") #短按两次需要清除标识 + if self.KeyAI_long_press == 0: if self.KeySOS_timer_flag == 0: self.KeySOS_timer_flag = 1 @@ -1306,9 +1312,7 @@ class AI_dev(Abstract): if self.KeySos_long_press == 1 and self.KeySOS_timer_flag == 1: self.KeySos_long_press=0 self.KeySOS_timer_flag=0 - get_sos_flag = EventMesh.publish("get_sos_flag") - if get_sos_flag == 0: - EventMesh.publish("set_sos_info_call") + self.KeySos_long_press=0 self.KeySOS_timer_flag = 0 return @@ -2668,6 +2672,7 @@ class AI_VC(Abstract): self.tts_in_data_len = 0 self.tts_out_data_len = 0 self.VC_satrt_flag = 0 + self.VC_stop_play_audio_flag = 0 self.VC_satrt_kws_flag = 0 self.session_id = "" EventMesh.subscribe("AI_key_press", self.AI_key_press) @@ -2986,7 +2991,8 @@ class AI_VC(Abstract): print("pwk_key_release") EventMesh.publish("publish_AI_btnInfo",{"func":self.Close}) EventMesh.publish("stop_sos_call") - EventMesh.publish("sleep_BT")#休眠蓝牙 + #EventMesh.publish("sleep_BT")#休眠蓝牙 + def key_prompt(self): EventMesh.publish("audio_montage_play",["key_prompt.mp3"]) @@ -4611,6 +4617,7 @@ class AI_VC(Abstract): print("AI_VC_start1") EventMesh.publish(constants.EVENT.SYSTEM_UP)#唤醒休眠 self.VC_satrt_flag = 1 + self.VC_stop_play_audio_flag = 1 self.VC_satrt_kws_flag = 1 if self.VC_Thinking_timerout < 100: self.VC_Thinking_timerout = 0 @@ -5045,9 +5052,9 @@ class AI_VC(Abstract): print("音频数据还有剩余!!!!!!!!!!!!") while True: try: - if self.AI_audio_queue_thread_lock == 2: - print("AI_audio_queue_thread 该退出了") - break + if self.AI_audio_queue_thread_lock == 2 or self.VC_stop_play_audio_flag == 0: + print("AI_audio_queue_thread 该退出了") + break # count+=1 if count%500 == 1: @@ -5134,6 +5141,7 @@ class AI_VC(Abstract): EventMesh.publish("audio_montage_play",["xinhaoruo1.mp3"]) def Close(self): + self.VC_stop_play_audio_flag = 0 self.VC_Thinking_timerout = 0 self.AI_ASR_timer.stop() self._1S_timer.stop() -- 2.17.1