Skip to main content

measure_all_dsp_algorithmic_latency

Function measure_all_dsp_algorithmic_latency 

Source
pub fn measure_all_dsp_algorithmic_latency(
    audio_service: State<'_, Mutex<AudioService>>,
) -> Result<Vec<AlgorithmicLatencyDto>, String>
Expand description

Returns the algorithmic (design-inherent) delay for every processor in the DSP chain.

Algorithmic latency is the sample delay an effect introduces by design — e.g. a look-ahead limiter adds a fixed number of samples regardless of CPU speed.

For the current chain (Gain → Tone Stack → Master Volume) all values are zero because no processor uses a delay line or look-ahead buffer. This command still exists to provide the correct data shape for the developer UI and to remain correct when future processors with non-zero delay are added.

Results are both logged at info level and returned to the frontend.

§Returns

Ok(latency) — a vector of exactly three AlgorithmicLatencyDto entries: Gain → Tone Stack → Master Volume, each with latency_samples = 0.

§Errors

Returns Err if the AudioService mutex cannot be locked.