Skip to content

feat: scenario presets (--preset voice|podcast|music|archive)#186

Open
seonghobae wants to merge 1 commit into
mainfrom
feat/scenario-presets
Open

feat: scenario presets (--preset voice|podcast|music|archive)#186
seonghobae wants to merge 1 commit into
mainfrom
feat/scenario-presets

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Why

Non-expert users shouldnt need to tune silence thresholds and codecs. --preset bundles sensible defaults for common scenarios in one flag.

What

  • New presets.py mapping presets to overrides of the real tunable flags:
    • voice — Opus, aggressive trim (-30dB/0.5s)
    • podcast — balanced Opus (-35dB/1.0s)
    • music — --flac-all, gentle silence (-45dB/3.0s)
    • archive — --flac-all, larger target (1.95GB), conservative (-50dB/4.0s)
  • Minimal wiring in parse_args. Explicit CLI flags always win over the preset (argparse namespace seeded with an _UNSET sentinel so user-set is distinguishable from default). No --preset = byte-identical to today.

Tests

+12 tests (each presets overrides, explicit-beats-preset precedence, unchanged defaults, unknown-preset rejection). media_shrinker.py 100% coverage; interrogate 100%; no new failures.

🤖 Generated with Claude Code

Add `--preset {voice,podcast,music,archive}` that applies sensible
bundled defaults over the real tunable flags so non-expert users get
good results with a single flag.

New presets.py maps each scenario to overrides over the actual argparse
dests (target_bytes, flac_all, silence_noise,
silence_min_duration_seconds, max_duration_seconds):
- voice: Opus + aggressive silence trimming (-30dB, 0.5s)
- podcast: balanced Opus (-35dB, 1.0s)
- music: --flac-all + gentler silence (-45dB, 3.0s)
- archive: --flac-all + larger target (1.95GB) + conservative silence

Precedence: explicit CLI flags always win over the preset; with no
--preset, output is byte-identical to today. Implemented by seeding the
argparse namespace with a sentinel for each preset-tunable dest so
"unset" is distinguishable from "set to the default value".

Tests cover each preset's overrides, explicit-flag precedence (including
store_true and value flags), unchanged defaults with no preset, unknown
preset rejection, and presets.py logic in isolation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CJRVbDrp1vGYkJgNHMGPpG
@seonghobae seonghobae enabled auto-merge (squash) July 6, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant