1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-07 04:13:47 +01:00

Allow microphone channel to be specified in config (#4871)

This commit is contained in:
Jesse Hills
2023-05-23 07:02:16 +12:00
committed by GitHub
parent 40d110fc3f
commit f7b5c6307c
3 changed files with 14 additions and 2 deletions

View File

@@ -28,6 +28,8 @@ class I2SAudioMicrophone : public I2SAudioIn, public microphone::Microphone, pub
}
#endif
void set_channel(i2s_channel_fmt_t channel) { this->channel_ = channel; }
protected:
void start_();
void stop_();
@@ -40,6 +42,7 @@ class I2SAudioMicrophone : public I2SAudioIn, public microphone::Microphone, pub
#endif
bool pdm_{false};
std::vector<uint8_t> buffer_;
i2s_channel_fmt_t channel_;
HighFrequencyLoopRequester high_freq_;
};