Add read interface to microphone (#5131)

This commit is contained in:
Jesse Hills
2023-08-08 09:45:56 +12:00
committed by GitHub
parent 9980b9972f
commit 0b1b25191d
3 changed files with 25 additions and 28 deletions
@@ -20,6 +20,7 @@ class Microphone {
void add_data_callback(std::function<void(const std::vector<int16_t> &)> &&data_callback) {
this->data_callbacks_.add(std::move(data_callback));
}
virtual size_t read(int16_t *buf, size_t len) = 0;
bool is_running() const { return this->state_ == STATE_RUNNING; }
bool is_stopped() const { return this->state_ == STATE_STOPPED; }