smaller audio buffer + fill with zeroes before starting
This commit is contained in:
parent
052bf829a5
commit
4496316f07
|
@ -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::<f32>::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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue