Module autocut

Source
Expand description

Auto-cut: find “loud” segments (speech) vs “quiet” ones (ambient) in an audio clip from its waveform peaks (media::waveform::Peaks, 100 buckets/s) — no extra decoding. Pure functions, unit-tested.

Structs§

AutoCutParams

Constants§

EPS 🔒

Functions§

loud_segments
Loud segments as (start, end) in SOURCE seconds within [src_in, src_in + src_len) of the analysed stream, merged/filtered per params and clamped to that window. Peak level per bucket = max(|min|, |max|) → dBFS. Empty peaks → empty result.
to_timeline
Turn source-time loud segments into timeline cut times + ranges to remove for a clip that starts at start with speed (forward only; reversed/frozen clips are not auto-cut): returns (cuts, quiet_ranges) in timeline seconds, quiet ranges = the complement of the loud segments inside the clip. keep_quiet swaps the roles (keep ambient, remove speech).