mirror of
https://github.com/esphome/esphome.git
synced 2024-12-04 20:48:21 +01:00
Fix microphone read empty check
This commit is contained in:
parent
6e09f4b4d7
commit
317ee53188
1 changed files with 1 additions and 1 deletions
|
@ -227,7 +227,7 @@ void ESPADFMicrophone::stop() {
|
|||
}
|
||||
|
||||
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
|
||||
}
|
||||
int bytes_read = rb_read(this->ring_buffer_, (char *) buf, len, 0);
|
||||
|
|
Loading…
Reference in a new issue