[microphone] Move bits_per_sample_ to the end of MicrophoneSource (#20146)

This commit is contained in:
J. Nick Koston
2026-10-04 15:38:05 -04:00
committed by GitHub
parent c6e3a5a165
commit 4b5375145a
@@ -34,7 +34,7 @@ class MicrophoneSource final {
*/
public:
MicrophoneSource(Microphone *mic, uint8_t bits_per_sample, int32_t gain_factor, bool passive)
: mic_(mic), bits_per_sample_(bits_per_sample), gain_factor_(gain_factor), passive_(passive) {}
: mic_(mic), gain_factor_(gain_factor), passive_(passive), bits_per_sample_(bits_per_sample) {}
/// @brief Enables a channel to be processed through the callback.
///
@@ -81,11 +81,11 @@ class MicrophoneSource final {
std::shared_ptr<std::vector<uint8_t>> processed_samples_;
Microphone *mic_;
uint8_t bits_per_sample_;
std::bitset<8> channels_;
int32_t gain_factor_;
bool enabled_{false};
bool passive_; // Only pass audio if ``mic_`` is already running
uint8_t bits_per_sample_;
};
} // namespace esphome::microphone