diff --git a/src/wasapi/voice.rs b/src/wasapi/voice.rs index 6be243b..eb3a9ea 100644 --- a/src/wasapi/voice.rs +++ b/src/wasapi/voice.rs @@ -378,6 +378,8 @@ impl Stream for SamplesStream { self.max_frames_in_buffer - padding }; + if frames_available == 0 { return Poll::NotReady; } + // Obtaining a pointer to the buffer. let (buffer_data, buffer_len) = { let mut buffer: *mut winapi::BYTE = mem::uninitialized();