Skip to content

Commit

Permalink
audio: return from init_audio on start_rec failure
Browse files Browse the repository at this point in the history
  • Loading branch information
stintel authored and kristiankielhofner committed Jan 10, 2024
1 parent aafa8db commit 43234c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "audio_thread.h"
#include "board.h"
#include "es7210.h"
#include "esp_check.h"
#include "esp_decoder.h"
#include "esp_http_client.h"
#include "esp_log.h"
Expand Down Expand Up @@ -963,7 +964,7 @@ esp_err_t init_audio(void)
init_ap_to_api();
}
free(speech_rec_mode);
start_rec();
ESP_RETURN_ON_ERROR(start_rec(), TAG, "start_rec failed");
es7210_adc_set_gain(config_get_int("mic_gain", DEFAULT_MIC_GAIN));

ESP_LOGI(TAG, "app_main() - start_rec() finished");
Expand Down

0 comments on commit 43234c6

Please sign in to comment.