diff --git a/src/processor/memory/mmio/apu.rs b/src/processor/memory/mmio/apu.rs index 3085f95..daaaba7 100644 --- a/src/processor/memory/mmio/apu.rs +++ b/src/processor/memory/mmio/apu.rs @@ -76,7 +76,7 @@ impl Default for Apu { .config(); let converter = Samplerate::new( - ConverterType::ZeroOrderHold, + ConverterType::SincFastest, CLOCK_SPEED as u32, config.sample_rate.0, 2, @@ -100,7 +100,7 @@ impl Default for Apu { } } -const CYCLES_PER_FRAME: usize = 70224; +const CYCLES_PER_FRAME: usize = 70224 / 4; impl Apu { pub fn init(&mut self) { @@ -118,8 +118,9 @@ impl Apu { &self.config, move |data: &mut [f32], _info: &cpal::OutputCallbackInfo| { for v in data { - if let Some(a) = executor::block_on(rx.pop()) { - *v = a; + match executor::block_on(rx.pop()) { + Some(a) => *v = a, + None => panic!("Audio queue disconnected!"), } } },