mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-07 05:13:31 +02:00
Add read interface to microphone (#5131)
This commit is contained in:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user