diff --git a/crates/tunal-player/src/ffmpeg.rs b/crates/tunal-player/src/ffmpeg.rs index 788c401..811d2d4 100644 --- a/crates/tunal-player/src/ffmpeg.rs +++ b/crates/tunal-player/src/ffmpeg.rs @@ -115,11 +115,9 @@ impl Ffmpeg { continue; } self.samples.clear(); - self.samples.extend( - self.bytes[..whole] - .chunks_exact(4) - .map(|b| f32::from_le_bytes([b[0], b[1], b[2], b[3]])), - ); + let (samples, _) = self.bytes[..whole].as_chunks::<4>(); + self.samples + .extend(samples.iter().map(|b| f32::from_le_bytes(*b))); self.bytes.copy_within(whole..total, 0); self.partial = total - whole; self.produced = true;