feat: scenario presets (--preset voice|podcast|music|archive)#186
Open
seonghobae wants to merge 1 commit into
Open
feat: scenario presets (--preset voice|podcast|music|archive)#186seonghobae wants to merge 1 commit into
seonghobae wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Non-expert users shouldnt need to tune silence thresholds and codecs.
--presetbundles sensible defaults for common scenarios in one flag.What
presets.pymapping presets to overrides of the real tunable flags:parse_args. Explicit CLI flags always win over the preset (argparse namespace seeded with an_UNSETsentinel 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.py100% coverage;interrogate100%; no new failures.🤖 Generated with Claude Code