File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -840,6 +840,13 @@ void init_audio(void)
840
840
esp_err_t ret ;
841
841
int gpio_level ;
842
842
843
+ hdl_ahc = audio_board_codec_init ();
844
+ gpio_set_level (get_pa_enable_gpio (), 0 );
845
+ ret = audio_hal_ctrl_codec (hdl_ahc , AUDIO_HAL_CODEC_MODE_BOTH , AUDIO_HAL_CTRL_START );
846
+ ESP_LOGI (TAG , "audio_hal_ctrl_codec: %s" , esp_err_to_name (ret ));
847
+ init_esp_audio ();
848
+ volume_set (-1 );
849
+
843
850
gpio_level = gpio_get_level (GPIO_NUM_1 );
844
851
if (gpio_level == 0 ) {
845
852
ESP_LOGW (TAG , "mute is activated, please unmute to continue startup" );
@@ -849,21 +856,15 @@ void init_audio(void)
849
856
}
850
857
}
851
858
852
- hdl_ahc = audio_board_codec_init ();
853
859
hdl_aha = audio_board_adc_init ();
854
- gpio_set_level (get_pa_enable_gpio (), 0 );
855
- ret = audio_hal_ctrl_codec (hdl_ahc , AUDIO_HAL_CODEC_MODE_BOTH , AUDIO_HAL_CTRL_START );
856
- ESP_LOGI (TAG , "audio_hal_ctrl_codec: %s" , esp_err_to_name (ret ));
857
860
858
861
init_audio_response ();
859
862
init_session_timer ();
860
863
if (strcmp (speech_rec_mode , "WIS" ) == 0 ) {
861
864
init_ap_to_api ();
862
865
}
863
866
free (speech_rec_mode );
864
- init_esp_audio ();
865
867
start_rec ();
866
- volume_set (-1 );
867
868
es7210_adc_set_gain (config_get_int ("mic_gain" , DEFAULT_MIC_GAIN ));
868
869
869
870
ESP_LOGI (TAG , "app_main() - start_rec() finished" );
You can’t perform that action at this time.
0 commit comments