#include <microphone_source.h>
|
| void | process_audio_ (const std::vector< uint8_t > &data, std::vector< uint8_t > &filtered_data) |
| |
Definition at line 17 of file microphone_source.h.
◆ MicrophoneSource()
| esphome::microphone::MicrophoneSource::MicrophoneSource |
( |
Microphone * | mic, |
|
|
uint8_t | bits_per_sample, |
|
|
int32_t | gain_factor, |
|
|
bool | passive ) |
|
inline |
◆ add_channel()
| void esphome::microphone::MicrophoneSource::add_channel |
( |
uint8_t | channel | ) |
|
|
inline |
Enables a channel to be processed through the callback.
If the microphone component only has reads from one channel, it is always in channel number 0, regardless if it represents left or right. If the microphone reads from both left and right, channel number 0 and 1 represent the left and right channels respectively.
- Parameters
-
| channel | 0-indexed channel number to enable |
Definition at line 47 of file microphone_source.h.
◆ add_data_callback()
template<typename F >
| void esphome::microphone::MicrophoneSource::add_data_callback |
( |
F && | data_callback | ) |
|
|
inline |
◆ get_audio_stream_info()
Gets the AudioStreamInfo of the data after processing.
- Returns
- audio::AudioStreamInfo with the configured bits per sample, configured channel count, and source microphone's sample rate
Definition at line 9 of file microphone_source.cpp.
◆ get_gain_factor()
| int32_t esphome::microphone::MicrophoneSource::get_gain_factor |
( |
| ) |
|
|
inline |
◆ is_passive()
| bool esphome::microphone::MicrophoneSource::is_passive |
( |
| ) |
const |
|
inline |
◆ is_running()
| bool esphome::microphone::MicrophoneSource::is_running |
( |
| ) |
const |
|
inline |
◆ is_stopped()
| bool esphome::microphone::MicrophoneSource::is_stopped |
( |
| ) |
const |
|
inline |
◆ process_audio_()
| void esphome::microphone::MicrophoneSource::process_audio_ |
( |
const std::vector< uint8_t > & | data, |
|
|
std::vector< uint8_t > & | filtered_data ) |
|
protected |
◆ set_gain_factor()
| void esphome::microphone::MicrophoneSource::set_gain_factor |
( |
int32_t | gain_factor | ) |
|
|
inline |
◆ start()
| void esphome::microphone::MicrophoneSource::start |
( |
| ) |
|
◆ stop()
| void esphome::microphone::MicrophoneSource::stop |
( |
| ) |
|
◆ bits_per_sample_
| uint8_t esphome::microphone::MicrophoneSource::bits_per_sample_ |
|
protected |
◆ channels_
| std::bitset<8> esphome::microphone::MicrophoneSource::channels_ |
|
protected |
◆ enabled_
| bool esphome::microphone::MicrophoneSource::enabled_ {false} |
|
protected |
◆ gain_factor_
| int32_t esphome::microphone::MicrophoneSource::gain_factor_ |
|
protected |
◆ mic_
| Microphone* esphome::microphone::MicrophoneSource::mic_ |
|
protected |
◆ passive_
| bool esphome::microphone::MicrophoneSource::passive_ |
|
protected |
◆ processed_samples_
| std::shared_ptr<std::vector<uint8_t> > esphome::microphone::MicrophoneSource::processed_samples_ |
|
protected |
The documentation for this class was generated from the following files: