Skip to main content

render_offline

Function render_offline 

Source
pub fn render_offline(
    graph: &mut AudioGraph,
    sample_rate: u32,
    inputs: &[Vec<f32>],
    block_sizes: &[usize],
    sink: &mut dyn AudioBlockSink,
    cancel: &CancelToken,
) -> Result<(), OfflineAudioError>
Expand description

Runs the same graph used by realtime hosts and writes exact project-rate blocks.

inputs are the graph’s buses, flattened: each bus’s planes in the graph’s layout, one bus after another. All channels must have the same length. The output is in the graph’s layout. Irregular block_sizes are repeated until the source is exhausted.

§Errors

Returns OfflineAudioError::InvalidInput when inputs are not exactly the graph’s buses, or for a malformed schedule, and OfflineAudioError::Sink when the destination rejects output.