ferraus silence trim
Remove leading and trailing silence, optionally long pauses too
Synopsis
ferraus silence trim <input> [options] [-o <output>]
What it does
Removes silence below --threshold from the start and end, leaving --keep of it so the sound does not start abruptly (--edges, the default). With --all, pauses inside the audio longer than --min are also shortened to --max-gap, joined with a short crossfade (Audition's Delete Silence).
This command is also an fx stage and a pipeline op: ferraus fx in.wav -o out.wav --fx "silence trim:key=value".
Examples
Strip dead air from both ends, keeping 10 ms
ferraus silence trim take.wav -o take_trimmed.wav
Also shorten every pause longer than 1 s to 700 ms
ferraus silence trim podcast.wav --all --threshold -50dB --max-gap 700ms -o tight.wav
Cut a one-shot sample right at its first and last sound so it plays instantly
ferraus silence trim sample.wav --threshold -50dB --keep 0ms -o sample_tight.wav
Keep natural pauses but shorten any silence over 3 s down to 1 s
ferraus silence trim lecture.wav --all --min 3s --max-gap 1s -o lecture_tight.wav
Options
| Flag | Type | Default | Meaning |
|---|---|---|---|
--edges | flag | — | Trim leading and trailing silence (the default behaviour) |
--all | flag | — | Also shorten long silences inside the audio |
--threshold | gain | -60dB | Level (dBFS) below which audio counts as silence |
--keep | time | 10ms | Silence (duration) kept before the first and after the last sound |
--min | time | 1s | With --all: inner silences longer than this (duration) are shortened |
--max-gap | time | 500ms | With --all: length (duration) inner silences are shortened to |
Global options
Every command also accepts the global options (-o, --json, --dry-run, --overwrite, --progress, ...). See Global options.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Processing failed |
| 2 | Usage or parameter error |
| 3 | Input missing or unreadable |
| 4 | Unsupported format or codec |
| 8 | Cancelled |
| 70 | Internal error (bug) |
Common mistakes
- Forgetting that outputs are never overwritten: pass
--overwriteor a new-opath when re-running. - Beat-based times (
4b,1/4) need a tempo: pass--bpmor write4b@120. - Gains need a unit when not in dB:
0.5xis a factor,-6and-6dBare decibels.
For models
- MCP tool:
ferraus_silence_trim - Schema:
ferraus schema silence trim - Pipeline:
{ op: silence trim, args: { ... } }(flag names with_instead of-) - fx stage: yes
{"command": "silence trim", "defaults": {"threshold": "-60dB", "keep": "10ms", "min": "1s", "max_gap": "500ms"}}