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.

The offline counterpart of the browser pump: the caller decodes each source once and the engine does gain, fades, panning, effects, bus summing and limiting. Irregular block_sizes repeat, so callers can prove the mix is independent of 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.