mirror of
https://github.com/esphome/esphome.git
synced 2025-02-01 18:50:55 +00:00
Fix microphone read empty check
This commit is contained in:
parent
6e09f4b4d7
commit
317ee53188
@ -227,7 +227,7 @@ void ESPADFMicrophone::stop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t ESPADFMicrophone::read(int16_t *buf, size_t len) {
|
size_t ESPADFMicrophone::read(int16_t *buf, size_t len) {
|
||||||
if (rb_bytes_available(this->ring_buffer_) == 0) {
|
if (rb_bytes_filled(this->ring_buffer_) == 0) {
|
||||||
return 0; // No data
|
return 0; // No data
|
||||||
}
|
}
|
||||||
int bytes_read = rb_read(this->ring_buffer_, (char *) buf, len, 0);
|
int bytes_read = rb_read(this->ring_buffer_, (char *) buf, len, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user