Skip to main content

log_attack_time

Function log_attack_time 

Source
pub fn log_attack_time(
    envelope: &[f32],
    sample_rate: f32,
) -> Result<f32, AudioError>
Expand description

Log (base 10) of the attack time of an amplitude envelope.

The attack runs from the first sample whose value exceeds START_THRESHOLD × max up to the sample of maximum amplitude (the “stop”). The returned value is log10(attack_seconds). Following Essentia, an effectively-zero attack is clamped to one sample so the log is finite.

§Errors