13namespace sound_level {
18 void setup()
override;
Helper class to easily give an object a parent of type T.
SoundLevelComponent * parent_
Base-class for all sensors.
void dump_config() override
void set_peak_sensor(sensor::Sensor *peak_sensor)
sensor::Sensor * rms_sensor_
void start()
Starts the MicrophoneSource to start measuring sound levels.
void set_rms_sensor(sensor::Sensor *rms_sensor)
std::unique_ptr< audio::AudioSourceTransferBuffer > audio_buffer_
uint32_t measurement_duration_ms_
void set_measurement_duration(uint32_t measurement_duration_ms)
microphone::MicrophoneSource * microphone_source_
void stop()
Stops the MicrophoneSource.
std::weak_ptr< RingBuffer > ring_buffer_
sensor::Sensor * peak_sensor_
void set_microphone_source(microphone::MicrophoneSource *microphone_source)
float get_setup_priority() const override
void stop_()
Internal start command that, if necessary, allocates audio_buffer_ and a ring buffer which / audio_bu...
uint64_t squared_samples_sum_
void play(Ts... x) override
void play(Ts... x) override
const float AFTER_CONNECTION
For components that should be initialized after a data connection (API/MQTT) is connected.
Providing packet encoding functions for exchanging data with a remote host.