From: azao <821478748@qq.com> Date: Tue, 10 Mar 2026 06:44:07 +0000 (+0800) Subject: 替换提示音 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=a97bc10049d615d017d2eab3b2504cdf59a6adc5;p=mirrors%2FASR1603_G5.git 替换提示音 --- 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 7fe1bfe2..e814b2b3 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 @@ -1050,8 +1050,8 @@ class AI_dev(Abstract): self.extint_wakeup_cta1_timer = osTimer() self.extint_wakeup_cta1.enable() else: - # self.pwk_key = ExtInt(ExtInt.GPIO41, ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.pwk_extint_cb) - self.pwk_key = ExtInt(ExtInt.GPIO26, ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.pwk_extint_cb) + self.pwk_key = ExtInt(ExtInt.GPIO41, ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.pwk_extint_cb) + # self.pwk_key = ExtInt(ExtInt.GPIO26, ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.pwk_extint_cb) self.extint_AI = ExtInt(ExtInt.GPIO22,ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.keyAI_extint_cb) self.extint_AI.enable() @@ -1451,7 +1451,7 @@ class AI_dev(Abstract): try: #print("AI_btn:keyAI_extint_cb{}".format(args[1])) #定义最短触发间隔 - MIN_TRIGGER_INTERVAL = 100 # 可根据需求调整,单位ms + MIN_TRIGGER_INTERVAL = 1 # 可根据需求调整,单位ms #记录上次按键触发时间(初始化放类的__init__里:self.last_ai_key_time = 0) current_time = utime.ticks_ms() # 获取当前毫秒时间 #重复按下,直接返回 @@ -1899,8 +1899,9 @@ class device_res_author(Abstract): url = "http://dmp-global.raisound.com/bz-api/dev/time" else: url = "https://dmp-api.qipai.com/qp-dmp-api/dev/time" - # url = "https://dmp-dev.raisound.com/dmp-api/dev/time" + #url = "https://dmp-dev.raisound.com/dmp-api/dev/time" url = "http://dmp.raisound.com/bz-api/dev/time"#金三 + print("dev_NTP:{}".format(url)) response = request.get(url,timeout=5) data = response.json() print("dev_NTP:{}".format(data)) @@ -2033,6 +2034,7 @@ class device_res_author(Abstract): url = "https://dmp-api.qipai.com/qp-dmp-api/dev/auth/active" url = "http://dmp.raisound.com/bz-api/dev/auth/active"#金三 # url = "https://dmp-dev.raisound.com/dmp-api/dev/auth/active" + print("dev_active:{}".format(url)) data =ujson.dumps(data) response = None response_result = 0 @@ -2153,6 +2155,7 @@ class device_res_author(Abstract): # headers_T = {"Content-Type":"application/x-www-form-urlencoded","Accept":"*/*","bz-dt":"{}".format(token)} # response = request.get(url,headers = headers_T,timeout=5) # data = response.json() + print("dev_sign_in:{}".format(sign_url)) headers_T ={"Content-Type":"application/json"} response_result = 0 response = 0 @@ -2587,7 +2590,7 @@ class AI_VC(Abstract): # import voiceCall # voiceCall.callStart("10086") # return - self.http_get_config_flag = 1 + self.http_get_config_flag = 0 if self.http_get_config_flag == 1: try: self.http_get_config()#获取/更新配置参数 @@ -3437,8 +3440,8 @@ class AI_VC(Abstract): def AI_key_press(self, event=None, msg = None):#按键按下 if dev_type == "7PIN": #2代产品要延时播放按键音 为了连接蓝牙后不播放按键音的问题 # print("1111111111播放按键音!!!!!!!!!!") - self.aud.aud_tone_play(10,400)#播放按键音 - + # self.aud.aud_tone_play(10,400)#播放按键音 + self.aud.play(1, 1, 'U:/static/start.mp3') #播放按键音 # 播放状态判定 if self.VC_state >= VC_State_TTSStart and self.VC_state <= VC_State_TTSEnd: print("【打断播放】设备正在说话,仅中断播放,不发起新对话") @@ -4400,6 +4403,7 @@ class AI_VC(Abstract): self.AI_TTS_str = "我没听清,请再说一遍" EventMesh.publish("open_led_blue") elif jsload_data["event"] == "asr.completed" :#asr 终止的标识 + self.aud.play(1, 1, 'U:/static/think.mp3') #播放按键音 print("self.commands_mode:{}".format(self.commands_mode)) if self.commands_mode ==2: ret= self.check_text(self.AI_ASR_str) @@ -5444,7 +5448,7 @@ class AI_VC(Abstract): EventMesh.publish("system_sleep_rest")#防止黑屏 self.close_timerout += 1 - if self.close_timerout > 60 and self.VC_mode != 1 :#:#20秒没数据就close 长按单次问答模式不关 + if self.close_timerout > 20 and self.VC_mode != 1 :#:#20秒没数据就close 长按单次问答模式不关 if self.VC_state >= VC_State_SpeechIng: print("接口无响应,超时退出") @@ -6409,6 +6413,7 @@ class AI_VC(Abstract): self.AI_ASR_check_timeout = 0 self.AI_ASR_error_timeout = 0 self.LocalRespondingEnded_timerout = 0 + self.is_ruppt_tts = 0#打断标志位清零 print("ai_VC Close1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!") EventMesh.publish("close_led") self.tts_in_data_len = 0 diff --git a/2.sdk/project/7PIN_1_5/usr/static/start.mp3 b/2.sdk/project/7PIN_1_5/usr/static/start.mp3 new file mode 100644 index 00000000..f9c4ccc9 Binary files /dev/null and b/2.sdk/project/7PIN_1_5/usr/static/start.mp3 differ diff --git a/2.sdk/project/7PIN_1_5/usr/static/think.mp3 b/2.sdk/project/7PIN_1_5/usr/static/think.mp3 new file mode 100644 index 00000000..78917f31 Binary files /dev/null and b/2.sdk/project/7PIN_1_5/usr/static/think.mp3 differ