按键音
authordxy <1731678236qq.com>
Wed, 22 Oct 2025 09:30:45 +0000 (17:30 +0800)
committerdxy <1731678236qq.com>
Wed, 22 Oct 2025 09:30:45 +0000 (17:30 +0800)
2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/ai_VC.py

index 568a85b..091d131 100644 (file)
@@ -46,8 +46,8 @@ PRESS_AUDIO_MODE = 0 #是按键音 0 是使用音频文件
 #dev_type = "7PIN_BK_coze"#k扣子小瑞
 #dev_type = "7PIN_BK_EU"#英文小瑞
 #dev_type = "7PIN_coze"#柒牌扣子
-# dev_type = "7PIN"#柒牌
-dev_type = "7PIN_1_5"#柒牌1.5
+dev_type = "7PIN"#柒牌
+# dev_type = "7PIN_1_5"#柒牌1.5
 #dev_type = 'momo'#食梦貘
 #dev_type = 'sjgq'#四季甘泉
 #dev_type = 'szbst'#深圳百事通
@@ -3115,7 +3115,8 @@ class AI_VC(Abstract):
             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)#播放按键音
+        print("播放按键音!!!!!!!!!!")
+        self.aud.aud_tone_play(10,400)#播放按键音
     def ai_key_press_audio_cb2(self, event=None, msg = None):
         self.chenggong_tone() #播放按键音
 
@@ -3135,7 +3136,11 @@ class AI_VC(Abstract):
         print("AI_key_press")
         self.get_config_timer_count = 0
         self.key_state = 1
-        self.aud.aud_tone_play(10,400)#播放按键音
+        if dev_type == "7PIN": #2代产品要延时播放按键音 为了连接蓝牙后不播放按键音的问题
+            self.aud.aud_tone_play(10,400)#播放按键音
+        elif dev_type == "7PIN_1_5": #2代产品要延时播放按键音 为了连接蓝牙后不播放按键音的问题
+            self.ai_key_press_audio.stop()
+            self.ai_key_press_audio.start(300, 0, self.ai_key_press_audio_cb1)
         if PRESS_AUDIO_MODE == 1:
             if dev_type == "7PIN" or dev_type == "7PIN_1_5":
                 if dev_type == "7PIN_1_5":
@@ -3193,13 +3198,16 @@ class AI_VC(Abstract):
         print("AI_key_press")
         self.get_config_timer_count = 0
         self.key_state = 1
+        self.aud.aud_tone_play(10,400)#播放按键音
         if PRESS_AUDIO_MODE == 1:
             if dev_type == "7PIN" or dev_type == "7PIN_1_5":
-                self.aud.aud_tone_play(10,200)#播放按键音
+                pass
+                # self.aud.aud_tone_play(10,400)#播放按键音
         self.Close()
         if PRESS_AUDIO_MODE == 0:
             if dev_type == "7PIN" or dev_type == "7PIN_1_5":
-                self.chenggong_tone()
+                pass
+                # self.chenggong_tone()
         
         if self.VC_mode == 1: #长按对话模式 接收到蓝牙耳机按键事件
             
@@ -5301,13 +5309,16 @@ class AI_VC(Abstract):
                     return
                 elif  EventMesh.publish("get_voice_record_mode") == 1: #静默录音需要打断
                     EventMesh.publish("stop_voice_record")#停止静默录音
+            self.aud.aud_tone_play(10,400)
             if PRESS_AUDIO_MODE == 1:
                 if dev_type == "7PIN" or dev_type == "7PIN_1_5" :
-                    self.aud.aud_tone_play(10,200)
+                    # self.aud.aud_tone_play(10,200)
+                    pass
             self.Close()
             if PRESS_AUDIO_MODE == 0:
                 if dev_type == "7PIN" or dev_type == "7PIN_1_5":
-                    self.chenggong_tone()
+                    pass
+                    # self.chenggong_tone()
             # if dev_type == "7PIN" :
             #     self.aud.aud_tone_play(10,400)#播放按键音
             #self.aud.aud_tone_play(10,200)#播放按键音