pub fn sample_conv<S, D>(frame: &[S]) -> Cow<'_, [D]>where
S: SampleType,
D: SampleType,Expand description
- Convert samples to another format by scaling. e.g.
u8toi16conversion is to scale[0, 255]into[-32768, +32767] - Upscaling is lossless. Beware, the precision of
f32is roughly the same asi24. Converti32tof32is lossy. i32tof64is lossless butf64for audio processing consumes lots of memory.