diff --git a/Cargo.toml b/Cargo.toml index d47c3c8..7a62603 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ num-complex = { version = "0.4", optional = true } num-integer = "0.1.45" num-traits = "0.2" #audioadapter = {path = "../audioadapter-rs"} -audioadapter = "0.1.0" +audioadapter = "0.2.0" [dev-dependencies] env_logger = "0.10.0" diff --git a/src/lib.rs b/src/lib.rs index fa52b27..9ab1eb9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -218,20 +218,8 @@ where "output, {} is longer than delay to trim, {}, trimming..", output_len, frames_to_trim ); - // move useful putput data to start of output buffer - for chan in 0..self.nbr_channels() { - if let Some(mask) = active_channels_mask { - if !mask[chan] { - continue; - } - } - for frame in 0..(output_len - frames_to_trim) { - let val = buffer_out - .read_sample(chan, frame + frames_to_trim) - .unwrap(); - buffer_out.write_sample(chan, frame, &val); - } - } + // move useful output data to start of output buffer + buffer_out.copy_frames_within(frames_to_trim, 0, frames_to_trim); // update counters output_len -= frames_to_trim; indexing.output_offset -= frames_to_trim;