soft_clip

Function soft_clip 

Source
pub fn soft_clip(
    pcm: &mut [f32],
    frame_size_per_ch: usize,
    channels: i32,
    softclip_mem: &mut [f32],
) -> Result<()>
Expand description

Apply libopus soft clipping to keep float PCM within [-1, 1].

The clipping state memory must be provided per-channel and preserved across calls for continuous processing. Initialize with zeros for a new stream.

ยงErrors

Returns Error::BadArg when the PCM slice, frame size, or soft-clip memory do not match the provided channel configuration.