Skip to main content

render_project_audio

Function render_project_audio 

Source
pub fn render_project_audio(
    snapshot: &EngineProject,
    request: &ProjectAudioRequest<'_>,
    sources: &dyn AudioBlockProvider,
    sink: &mut dyn AudioBlockSink,
    cancel: &CancelToken,
) -> Result<(), OfflineAudioError>
Expand description

Mixes a whole project audio range and writes exact project-rate blocks.

This is the offline counterpart of the browser pump: the caller decodes each source once, and the engine owns gain, fades, panning, effects, bus summing, and limiting. Irregular block_sizes are repeated so callers can prove the mix does not depend on the host’s block size.

§Errors

Returns OfflineAudioError::InvalidInput for an empty schedule or range, OfflineAudioError::Engine when the renderer rejects the configuration, OfflineAudioError::MissingSources when an audible clip had no decoded media, and OfflineAudioError::Sink when the destination rejects output.