Skip to content

Commit

Permalink
esp_rtc: Fix esp-rtc example no audio
Browse files Browse the repository at this point in the history
  • Loading branch information
TempoTian committed Sep 3, 2024
1 parent 536c989 commit 41f94ef
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,14 @@ int av_stream_audio_read(char *buf, int len, TickType_t wait_time, bool uac_en)
return ret;
} else {
ret = audio_element_input(i2s_io_reader, buf, len);
if (ret < 0) {
ESP_LOGE(TAG, "i2s read failed");
if (ret <= 0) {
ESP_LOGE(TAG, "i2s fail read ret %d", ret);
return ret;
}
#if (CONFIG_IDF_TARGET_ESP32 && !RECORD_HARDWARE_AEC)
algorithm_mono_fix((uint8_t *)buf, bytes_read);
#endif
bytes_read = ret;
}

return bytes_read;
Expand Down

0 comments on commit 41f94ef

Please sign in to comment.