C.W.K.
Stream
Lesson 09 of 10 · published

Silence Detection & Removal

~10 min · silence, detect, trim, podcast

Level 0Viewer
0 XP0/73 lessons0/15 achievements
0/100 XP to next level100 XP to go0% complete

Two filters, two jobs

  • silencedetect — analyzes audio and prints silence start/end timestamps. Use this for editing prep — feed timestamps into a cut/concat pipeline.
  • silenceremove — actually removes silence in real-time. Trim leading/trailing silence, or compress all internal pauses.

Tuning

Silence threshold (n) is in dB. -30 dB catches breathing, -50 dB only catches near-true silence. Duration (d) sets minimum silence length to trigger. For talk-track cleanup, n=-30dB d=0.5 is a sane starting point.

Code

Detect silences·bash
# Print every silence longer than 1 second below -30 dB
ffmpeg -i podcast.wav -af "silencedetect=n=-30dB:d=1" -f null - 2>&1 | \
  grep silence_
# [silencedetect @ 0x...] silence_start: 12.345
# [silencedetect @ 0x...] silence_end: 14.567 | silence_duration: 2.222
# ...
Remove leading/trailing silence·bash
# Trim silence from start and end (the typical podcast/TTS clean-up)
ffmpeg -i raw.wav \
  -af "silenceremove=start_periods=1:start_silence=0.1:start_threshold=-40dB:detection=peak,areverse,silenceremove=start_periods=1:start_silence=0.1:start_threshold=-40dB:detection=peak,areverse" \
  trimmed.wav
Compress internal pauses (talk-track tightening)·bash
# Replace any silence > 1.5s with 0.5s of silence
ffmpeg -i podcast.wav \
  -af "silenceremove=stop_periods=-1:stop_duration=0.5:stop_threshold=-30dB" \
  tight.wav

# stop_periods=-1 = all internal pauses
# stop_duration is the maximum silence length kept
# stop_threshold is the silence detection level

External links

Exercise

Take a podcast WAV with natural pauses. Run silencedetect at three thresholds (-25, -30, -40 dB) and see how the count differs. Then trim leading/trailing silence with the recipe above. Compare durations: original vs trimmed. Bonus: write a 5-line shell script that auto-trims any voice file dropped on it.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.