weirdnet_audio_record/lib.rs
1//! Recording for Weirdnet audio: stems, device outputs and a mix, with latency records and
2//! take manifests.
3//!
4//! * A [`StemRecorder`] places incoming audio by position on the session clock, fills gaps
5//! with silence and notes them, and ignores audio that arrives twice.
6//! * A [`Take`] holds the stems of one recording with a [`Manifest`]: per source its kind
7//! (stem, device output, mix), where it starts, its latency record, the offset computed from
8//! it and a manual trim.
9//! * [`Take::aligned`] cuts every source to the take's range, shifted by its offset, so all
10//! sources have equal length; [`mix`] sums them. Changing a trim and exporting again
11//! re-aligns.
12//! * [`estimate_offset`] finds the lag between a reference and a delayed copy, for measuring
13//! latency from a test signal.
14//! * [`wav`] writes and reads 32-bit float WAV; [`Take::write`] writes stems, the mix and
15//! `manifest.json` to a folder.
16#![forbid(unsafe_code)]
17
18mod align;
19mod stem;
20mod take;
21pub mod wav;
22
23pub use align::{estimate_offset, mix};
24pub use stem::{Gap, Stem, StemRecorder};
25pub use take::{Manifest, RecordError, SourceEntry, SourceKind, Take};
26pub use weirdnet_audio_route::{LatencyQuality, PortLatency as LatencyRecord};