Allow i2s microphone bits per sample to be configured (#4884)

This commit is contained in:
Jesse Hills
2023-05-26 15:50:44 +12:00
committed by GitHub
parent 9cd173ef83
commit 79abd773a2
7 changed files with 54 additions and 14 deletions
+2 -2
View File
@@ -16,10 +16,10 @@ template<typename... Ts> class StopCaptureAction : public Action<Ts...>, public
void play(Ts... x) override { this->parent_->stop(); }
};
class DataTrigger : public Trigger<const std::vector<uint8_t> &> {
class DataTrigger : public Trigger<const std::vector<int16_t> &> {
public:
explicit DataTrigger(Microphone *mic) {
mic->add_data_callback([this](const std::vector<uint8_t> &data) { this->trigger(data); });
mic->add_data_callback([this](const std::vector<int16_t> &data) { this->trigger(data); });
}
};