diff --git a/src/processor/memory/mmio/apu.rs b/src/processor/memory/mmio/apu.rs index fcb9ae3..618a396 100644 --- a/src/processor/memory/mmio/apu.rs +++ b/src/processor/memory/mmio/apu.rs @@ -106,10 +106,12 @@ const CYCLES_PER_FRAME: usize = 70224; impl Apu { pub fn init(&mut self) { let sample_rate = self.config.sample_rate.0; - let rb_len = sample_rate as usize; + let rb_len = sample_rate as usize / 60; let rb = AsyncHeapRb::::new(rb_len); - let (tx, mut rx) = rb.split(); + let (mut tx, mut rx) = rb.split(); + + executor::block_on(tx.push_iter(vec![0.; rb_len - 1].into_iter())).unwrap(); self.send_rb = Some(tx);