AUDIO
Source snapshot · 12 October 2026

API reference / ravet_signal::prepare_impulse_response

Function prepare_impulse_response 

pub fn prepare_impulse_response(
    source_rate: u32,
    source: &[&[f64]],
    request: &ImpulseResponseRequest<'_>,
) -> Result<PreparedImpulseResponse, ImpulseResponseError>
Expand description

Prepare a response from planar f64 source channels at source_rate for the request’s target engine rate. Every policy, bound and the declared byte budget is checked (see ImpulseResponseRequest::plan) and the whole source is checked for equal lengths and finiteness before any allocation. Stages run in the fixed order map, convert, trim, normalize; a refusal at any stage returns no partial result.

Sinc conversion feeds the source and exactly enough explicit zeros (at most taps) through a freshly reset SincResampler per output channel and keeps ImpulseResponsePlan::staged_frames frames. Converted samples are staged * rate_gain; normalized samples are trimmed * normalization_gain, each one f64 rounding. An exact copy performs no arithmetic.

This allocates and is CONTROL/worker work only. No deadline is implied.