15static const int32_t MAX_GAIN_FACTOR = 64;
86 std::vector<uint8_t> &filtered_data);
uint32_t get_sample_rate() const
void add_data_callback(F &&data_callback)
Callbacks take (const AudioCapture &) and run on the microphone's task.
void set_gain_factor(int32_t gain_factor)
void process_audio_(std::span< const uint8_t > data, const audio::AudioStreamInfo &source_info, std::vector< uint8_t > &filtered_data)
MicrophoneSource(Microphone *mic, uint8_t bits_per_sample, int32_t gain_factor, bool passive)
void add_data_callback(F &&data_callback)
Same callbacks as Microphone::add_data_callback; stream_info is the processed format.
std::shared_ptr< std::vector< uint8_t > > processed_samples_
std::bitset< 8 > channels_
void add_channel(uint8_t channel)
Enables a channel to be processed through the callback.
int32_t get_gain_factor()
audio::AudioStreamInfo get_audio_stream_info()
Gets the AudioStreamInfo of the data after processing.
auto as_capture_callback(F &&callback)
int64_t capture_time_us
esp_timer_get_time() of the first frame, or 0 if unknown
audio::AudioStreamInfo stream_info
Format of data.
std::span< const uint8_t > data
Only valid during the callback.