#pragma once #include #include #include "esp_err.h" #include "freertos/FreeRTOS.h" #include "feature_params.h" typedef struct { const int16_t *pcm; // FRAME_LEN samples, valid until audio_in_release_frame() uint8_t idx; // slot index to hand back uint32_t seq; // monotonically increasing frame number } audio_frame_t; esp_err_t audio_in_init(void); // creates the I2S RX channel and the frame pool esp_err_t audio_in_start(void); // starts the capture task (pinned to core 1) bool audio_in_get_frame(audio_frame_t *f, TickType_t wait); void audio_in_release_frame(uint8_t idx); uint32_t audio_in_frames_captured(void); uint32_t audio_in_frames_dropped(void); // processing fell behind