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

FlagTypeDefaultMeaning
--edgesflag—Trim leading and trailing silence (the default behaviour)
--allflag—Also shorten long silences inside the audio
--thresholdgain-60dBLevel (dBFS) below which audio counts as silence
--keeptime10msSilence (duration) kept before the first and after the last sound
--mintime1sWith --all: inner silences longer than this (duration) are shortened
--max-gaptime500msWith --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

CodeMeaning
0Success
1Processing failed
2Usage or parameter error
3Input missing or unreadable
4Unsupported format or codec
8Cancelled
70Internal error (bug)

Common mistakes

  • Forgetting that outputs are never overwritten: pass --overwrite or a new -o path when re-running.
  • Beat-based times (4b, 1/4) need a tempo: pass --bpm or write 4b@120.
  • Gains need a unit when not in dB: 0.5x is a factor, -6 and -6dB are 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"}}