pub fn tc_to_total(envelope: &[f32]) -> Result<f32, AudioError>Expand description
Temporal centroid of envelope (the amplitude-weighted mean index),
normalised to [0, 1) by the total length. For a symmetric envelope the
centroid sits at the middle (≈ 0.5); an early-weighted envelope returns a
smaller value.
§Errors
AudioError::InvalidParameterifenvelopeis empty or its total (absolute) weight is zero.