songbird-export/src/
├── lib.rs — Public API (ExportConfig, StemConfig, export_master, export_stems)
├── render.rs — Offline render loop (advances transport, processes graph, writes samples)
└── bounce.rs — Track bounce (render-in-place for a single track)
let config = ExportConfig {
output_path: "/path/to/output.wav".into(),
sample_rate: 44100,
bit_depth: 24,
start_seconds: 0.0,
end_seconds: 120.0,
normalize: true,
};
let result = export_master(&graph, &transport, &clip_scheduler, &config);
let stem_config = StemConfig {
output_dir: "/path/to/stems/".into(),
tracks: vec![0, 1, 2, 3], // Track indices to export
};
let results = export_all_stems(&graph, &transport, &clip_scheduler, &config, &stem_config);
let result = bounce_track(&graph, &transport, &clip_scheduler, track_index, &config);
ExportConfig
→ Create offline Transport (non-realtime)
→ Loop: advance transport by block_size samples
→ ClipScheduler resolves active clips
→ AudioGraph.process() renders one block
→ Accumulate output samples
→ Normalize if requested (peak or LUFS)
→ Write WAV file via hound
→ Return ExportResult { path, duration, peak_level, ... }
cargo test -p songbird-export