Sermon-clean v0.2.0. Five new subcommands that round out the editor:
- normalize (norm): Apply EBU R128 two-pass loudness normalization.
Default -16 LUFS (podcast/YouTube). Configurable target LUFS, true
peak, and loudness range. Output reports measured input loudness
and applied gain offset.
- silence-stats (ss): Quantitative summary of silence distribution —
count, total/mean/median/longest silence, silence fraction, and
silence runs per minute. Outputs JSON via --json. Useful for
comparing recordings and picking the right threshold.
- threshold-tune (tt): Auto-pick the silence threshold for the audio.
Scans a set of candidate thresholds (default -25..-50), scores each
against the target silence-runs-per-minute (default 4.0), picks the
closest match. Shows the full scoring table.
- denoise: Apply ffmpeg's afftdn filter for light FFT-based noise
reduction. Configurable noise reduction dB (default 12) and noise
floor dB (default -50). Output at 48kHz to match normalize.
- batch: Run any of the subcommands across many files via glob.
Output goes to --output-dir with --suffix (default '-fixed') and
optional --extension override. Failures are collected, not raised
— one bad file doesn't kill the whole batch.
Implementation:
- sermon_clean/processing.py: normalize_loudness + SilenceStats
dataclass + silence_stats + threshold_tune.
- sermon_clean/denoise.py: DenoiseResult + denoise.
- sermon_clean/batch.py: run_batch + _expand_globs + _make_output_path.
- sermon_clean/cli.py: 5 new cmd_* functions + 5 subparser registrations.
Tests:
- tests/test_processing.py (7 tests): silence-stats on silent vs loud,
threshold-tune picks closest, normalize produces output + measures loud.
- tests/test_denoise_batch.py (11 tests): denoise roundtrip, batch
helpers (glob expansion, output naming), batch run with normalize
+ denoise, unknown subcommand raises, one-bad-file-in-batch continues.
Total: 82/82 tests passing in 48s (was 64/64). Bumped version to 0.2.0.
README updated: step-by-step workflow adds 1d-1g; subcommand table
adds the 5 new commands; new 'Batch processing' section.
The uncommitted code from the last session was a working silence-index
subcommand wired through cli.py — but it never landed on main. This
commit:
- Adds render_silence_index() to waveform.py (was already on disk but
uncommitted) — tabular view of silence runs with start/end/duration
and a position bar showing where each run falls in the audio.
- Wires it through cli.py as 'silence-index' (alias: 'si') with
--silence-threshold and --silence-min-duration args.
- Adds 2 tests: test_render_silence_index_empty_audio (silent file
produces 1 run with bar) and test_render_silence_index_no_silences_message
(loud sine at -100dB threshold → 'no silence runs' message).
- Updates README: 'si' added to step-by-step workflow and the
subcommand table, alongside the previously-uncommitted 'mb' (multiband).
64/64 tests passing in 14.6s.
Use case: when picking natural splice points to bracket a bad word,
you want a tabular list of silence runs you can eyeball, not a
waveform. si is the right tool for that — also faster than mb on long
files since it doesn't need to render bars per band.
- waveform.py: render_multiband_waveform() — N rows of ASCII bars, each row
labeled with its band-start time. Makes it easy to find timestamps in
long audio by counting row + column.
- cli.py: new 'multiband' / 'mb' subcommand
- Fixed: multiband band alignment was drifting (off-by-one in samples)
- tests: 1 new multiband smoke test; 62 total all passing