correct for machine cycles
This commit is contained in:
parent
7a28655604
commit
e150005eda
|
@ -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!"),
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue