From: dxy <1731678236qq.com> Date: Fri, 19 Sep 2025 06:26:57 +0000 (+0800) Subject: 按键延时200ms播放 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=f5cf2b9d4c8797555f9e5ab4ff52d749d762db56;p=mirrors%2FASR1603_G5.git 按键延时200ms播放 --- 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 43fc47a4..133bcb3c 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 @@ -2465,6 +2465,7 @@ class AI_VC(Abstract): except Exception as e: usys.print_exception(e) self.VC_30S_timer = osTimer() + self.ai_key_press_audio = osTimer() self.VC_30S_timer.start(30000, 1, self.VC_30S_timer_cb) self.online_kws = 1#是否开启线上关键词 self.get_config_timer_count = 0 @@ -3096,6 +3097,11 @@ class AI_VC(Abstract): exit_tts ="已退出语音留言模式" EventMesh.publish("play_tts",[exit_tts,1]) pass + def ai_key_press_audio_cb1(self, event=None, msg = None): + self.aud.aud_tone_play(10,200)#播放按键音 + def ai_key_press_audio_cb2(self, event=None, msg = None): + self.chenggong_tone() #播放按键音 + def AI_key_press(self, event=None, msg = None):#按键按下 EventMesh.publish(constants.EVENT.SYSTEM_UP)#唤醒休眠 if EventMesh.publish("get_sos_flag")== 1: @@ -3114,11 +3120,15 @@ class AI_VC(Abstract): self.key_state = 1 if PRESS_AUDIO_MODE == 1: if dev_type == "7PIN" or dev_type == "7PIN_1_5": - self.aud.aud_tone_play(10,200)#播放按键音 + self.ai_key_press_audio.stop() + self.ai_key_press_audio.start(300, 0, self.ai_key_press_audio_cb1) + # self.aud.aud_tone_play(10,200)#播放按键音 self.Close() if PRESS_AUDIO_MODE == 0: if dev_type == "7PIN" or dev_type == "7PIN_1_5": - self.chenggong_tone() + self.ai_key_press_audio.stop() + self.ai_key_press_audio.start(200, 0, self.ai_key_press_audio_cb2) + # self.chenggong_tone() # if dev_type == "7PIN": # self.chenggong_tone() #self.aud.aud_tone_play(10,200)#播放按键音