From 595951d7c0b4e03b664b14f0d79c4ededcbc0846 Mon Sep 17 00:00:00 2001 From: Bart Brouns Date: Sun, 14 Apr 2024 06:07:43 +0200 Subject: [PATCH] allocate audio buffers on the heap --- src/lib.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 56efd38..cb28d44 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,8 +21,8 @@ pub struct Lamb { params: Arc, dsp: Box, accum_buffer: TempBuffer, - temp_output_buffer_l: [f64; MAX_SOUNDCARD_BUFFER_SIZE], - temp_output_buffer_r: [f64; MAX_SOUNDCARD_BUFFER_SIZE], + temp_output_buffer_l: Box<[f64]>, + temp_output_buffer_r: Box<[f64]>, /// sample rate sample_rate: f32, @@ -50,8 +50,9 @@ impl Default for Lamb { dsp: dsp::LambRs::default_boxed(), accum_buffer: TempBuffer::default(), - temp_output_buffer_l: [0.0_f64; MAX_SOUNDCARD_BUFFER_SIZE], - temp_output_buffer_r: [0.0_f64; MAX_SOUNDCARD_BUFFER_SIZE], + + temp_output_buffer_l : f64::default_boxed_array::(), + temp_output_buffer_r : f64::default_boxed_array::(), sample_rate: 48000.0, } }