Fix microphone read empty check

This commit is contained in:
Jesse Hills 2024-01-11 09:51:06 +09:00
parent 6e09f4b4d7
commit 317ee53188
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A

View file

@ -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);