Skip to main content

compare_fitted

Function compare_fitted 

Source
pub fn compare_fitted(
    recording: &Audio,
    what: &str,
    renders: &[ClipMetrics],
    rows: &[SpreadRow],
) -> Result<FittedComparison, SpreadError>
Expand description

Fits the gain of recording to renders, applies it and compares the result on the ClipOutput::SHAPE outputs.

The gain moves the recording’s end too, since the end is the last sample above a fixed tail floor, so the duration compares after it.

§Errors

Returns SpreadError::Silent, naming what, for a silent recording, SpreadError::Audio for a recording the gain cannot scale, and the errors of compare.