Browse Source

添加天问唤醒词

xuxinyi 4 tháng trước cách đây
mục cha
commit
ce7b8cf3c3

+ 2 - 2
main/boards/movecall-moji-esp32s3/config.h

@@ -21,8 +21,8 @@
 
 #define BUILTIN_LED_GPIO        GPIO_NUM_21
 #define BOOT_BUTTON_GPIO        GPIO_NUM_0
-#define ASR_BUTTON_GPIO       GPIO_NUM_18
-
+#define ASR_BUTTON_GPIO       GPIO_NUM_1
+#define ASR_TIAN_WEN_BUTTON_GPIO       GPIO_NUM_2
 #define DISPLAY_WIDTH   240
 #define DISPLAY_HEIGHT  240
 #define DISPLAY_MIRROR_X true

+ 8 - 1
main/boards/movecall-moji-esp32s3/movecall_moji_esp32s3.cc

@@ -55,6 +55,7 @@ private:
     i2c_master_bus_handle_t codec_i2c_bus_;
     Button boot_button_;
     Button asr_button_;
+    Button asr_tian_wen_button_;
     Display* display_;
 
     void InitializeCodecI2c() {
@@ -135,6 +136,11 @@ private:
             std::string wake_word="你好小智";
             Application::GetInstance().WakeWordInvoke(wake_word);
         });
+
+        asr_tian_wen_button_.OnPressUp([this]() {
+            std::string wake_word="你好小智";
+            Application::GetInstance().WakeWordInvoke(wake_word);
+        });
     }
 
     // 物联网初始化,添加对 AI 可见设备
@@ -146,7 +152,8 @@ private:
 
 public:
     MovecallMojiESP32S3() : boot_button_(BOOT_BUTTON_GPIO),
-    asr_button_(ASR_BUTTON_GPIO){  
+    asr_button_(ASR_BUTTON_GPIO),
+    asr_tian_wen_button_(ASR_TIAN_WEN_BUTTON_GPIO) {  
         InitializeCodecI2c();
         InitializeSpi();
         InitializeGc9a01Display();