SoX · Reviews

SoX review: trim interview dead air and land a 16 kHz mono WAV before whisper

On our 74.40-second test voice-over, SoX v14.4.2 cut head and tail silence to 64.16 s, then compressed the mid pauses to 58.09 s, and wrote a 16 kHz mono WAV of the same length. The one-line trap that uses below-periods=1 without a reverse step left 0.37 s of audio.

ToolBrivio editorial · Published · Tested October 30, 2026 · Sources checked October 30, 2026

SoX v14.4.2 lab cover: soxi -D 74.399729 s input, 64.161458 s after head/tail trim, 58.092375 s after mid-pause compress and again after rate 16k, beside pitfall soxi -D 0.371167 s when below-periods equals 1, over peak envelopes of the fixture WAVs.
Reviews cover, October 30, 2026. Left: real soxi -D durations from this lab on one fixture, with peak envelopes of the WAVs at each stage. Right: the below-periods=1 pitfall that stopped at 0.371167 s, plus the 10% vs 1% threshold compare. Bottom: the 16 kHz mono soxi dump and rate/dither clip warnings. Monospace lines are copied from our lab log. Not a GUI.

By ToolBrivio Editorial · Hands-on test of SoX v14.4.2 (Debian package 14.4.2+git20190427-5+b3) on Debian 13, October 30, 2026. The test audio is our own: a text-to-speech voice reading a script we wrote, with digital silence we added. FFmpeg 7.1.5 built the fixture and cross-checked silence regions. We earn no affiliate commission from links on this page. Research approach · Link disclosure.

You have interview or voice-over takes with dead air at both ends and a couple of long mid pauses. The next step is whisper.cpp for a caption draft, or FFmpeg loudnorm for delivery loudness. You want those gaps cleaned on the command line first, without opening a GUI for this one pass.

That is the job we gave SoX. The complaints we kept finding in SoX docs and Q&A were practical: the silence effect grammar is hard to memorize (above/below periods, threshold, -l), a threshold set too high can eat quiet speech, head/tail-only recipes differ from mid-pause handling, and you still need a safe path to 16 kHz mono for whisper. We built a fixture around those questions and measured every output with soxi.

The short answer

SoX does this prep well on a local box. It does not replace loudnorm, and it is not a noise-reduction tool. These are the commands we would start from on a mono WAV take:

# 1) Head and tail only (reverse trick)
sox interview.wav trim_ends.wav silence 1 0.1 1% reverse silence 1 0.1 1% reverse

# 2) Also shorten long mid pauses, leave a short gap (-l)
sox interview.wav mid.wav silence -l 1 0.1 1% -1 2.0 1%

# 3) 16 kHz mono WAV for whisper.cpp
sox mid.wav -r 16000 -c 1 -b 16 interview_16k.wav rate 16k channels 1

Then hand the 16 kHz file to whisper, or keep working in 48 kHz and loudnorm later. Our whisper.cpp review is the caption step. Our FFmpeg loudnorm review is the loudness step. Do not treat SoX norm or gain as EBU R128 loudnorm.

  • Good: head/tail trim on our file went from 74.399729 s to 64.161458 s (removed 10.238271 s).
  • Good: mid-pause compress with -l landed at 58.092375 s. On a clean synthetic gap file, the same recipe left gaps of 2.019854 s.
  • Good: rate 16k channels 1 wrote a 16 kHz mono WAV at 58.092375 s (1.86 MB).
  • Con: silence 1 0.1 1% 1 0.1 1% (below-periods positive 1, no reverse) stopped at the first mid silence and left 0.371167 s.
  • Con: a 10% threshold ate 0.874250 s more edge than 1% on the same head/tail trim.
  • Limit: on soft TTS onsets, leftover "silence" after -l may be shorter than the leave value when you re-measure with a strict digital-silence detector. Measure with soxi -D.

What we fed it

Real client audio was off the table, so we reused three English TTS parts from yesterday's whisper fixture (Piper en_US-lessac-medium, script with fictional names Maya Delgado and Jordan Whitaker, Seattle). We rebuilt them without the music bed: digital silence only.

Time (s)What's there
0 to 5.005 s digital silence (head)
5.00 to 23.88Part 1 voice (~18.88 s)
23.88 to 26.883 s digital silence (mid)
26.88 to 47.83Part 2 voice (~20.96 s)
47.83 to 51.834 s digital silence (mid)
51.83 to 69.40Part 3 voice (~17.57 s)
69.40 to 74.405 s digital silence (tail)

Master file: interview_master_48k_mono.wav, PCM s16le, 48000 Hz, 1 channel, 7,142,452 bytes. soxi -D = 74.399729. FFmpeg silencedetect at -50 dB / min 1.0 s saw head 5.005896 s, mid 3.237646 s and 4.212042 s, tail 5.191229 s.

Terminal capture: sox --version SoX v14.4.2, soxi on the 48 kHz mono input showing 74.399729 s, then soxi -D 64.161458 after head/tail trim and 58.092375 after mid-pause compress.
Verbatim soxi durations from this lab, October 30, 2026. Input 74.399729 s, head/tail trim 64.161458 s, mid compress 58.092375 s.

Head and tail only

The man page for silence is dense. The pattern that actually trims both ends, without also eating mid pauses, is the reverse chain documented in Stack Overflow and in the long-standing Digital Cardboard write-up:

sox in.wav out.wav silence 1 0.1 1% reverse silence 1 0.1 1% reverse

Read it as: wait for 0.1 s of audio above 1% of full scale, drop everything before that, reverse, do the same for the new "front" (the old tail), reverse back. On our file that landed at 64.161458 s. The two mid gaps stayed: FFmpeg still saw 3.237646 s and 4.212042 s of digital silence after this pass.

Use a trailing .0 on whole-second durations when you write them (2.0 not 2). SoX otherwise treats a bare integer as a sample count. Thresholds are often written as a percent; 0% is pure digital zero, and several guides warn that very small values can behave oddly, so we started at 1%.

Mid pauses with -l

To shorten long mid pauses but leave a short gap, the documented switch is -l (leave), with a negative below-periods so detection restarts through the file:

sox in.wav out.wav silence -l 1 0.1 1% -1 2.0 1%

On our VO, soxi -D became 58.092375 s (removed 16.307354 s from the input). A 0.5 s leave value landed at 55.443208 s.

We also checked the leave behavior on a clean synthetic file: 3 s silence + 2 s tone + 4 s silence + 2 s tone + 3 s silence (14.000000 s). The same -l ... -1 2.0 1% command wrote 8.039417 s, and FFmpeg measured two remaining gaps of 2.019854 s each. So the leave-2-second recipe works on hard digital silence.

On the TTS fixture, a strict -50 dB / 1.0 s detector did not find a remaining gap that long after the -l 2.0 pass. Soft speech edges sit near the 1% threshold, so the "silence" SoX sees is not the same rectangle FFmpeg labels at -50 dB. Trust soxi -D, listen once, and tighten the threshold only after you see what disappeared.

Terminal capture: synthetic gap file 14.000000 s becomes 8.039417 s with silence -l leave 2.0, two silence_duration lines of 2.019854 s, then a three-take batch loop with wall_s=0.063 and 16 kHz mono outputs.
Synthetic proof that -l can leave ~2.02 s gaps, plus the batch loop wall time 0.063 s. Verbatim lab log, October 30, 2026.

16 kHz mono for whisper

sox mid_compress_2s.wav -r 16000 -c 1 -b 16 interview_16k_mono.wav rate 16k channels 1

soxi on the result: 16000 Hz, 1 channel, 16-bit PCM, duration 58.092375 s, file size 1.86 MB. SoX printed rate clipped 7 samples and dither clipped 5 samples on this pass. For a caption draft that is a warning, not a stop. If you need peak-safe conversion, add a small gain or norm -1 before rate. We did not claim any listening improvement from that warning.

Terminal capture: sox rate 16k channels 1 with rate/dither clip warnings, soxi showing Sample Rate 16000, Channels 1, Duration 58.092375 s.
16 kHz mono handoff file confirmed by soxi. Same duration as the mid-compress input: 58.092375 s.

The pitfall we hit on purpose

Two traps showed up on this fixture.

1. Positive below-periods without reverse. This looks like a neat "trim both ends" line:

sox in.wav out.wav silence 1 0.1 1% 1 0.1 1%

It is not. After the first stretch of mid silence that meets the below duration, SoX stops copying. Our output was 0.371167 s. Digital Cardboard's Example 3 describes the same stop-on-silence behavior. For head and tail only, use the reverse chain. For mid pauses, use a negative below-periods (-1).

2. Threshold too high. The same reverse head/tail recipe at 10% instead of 1% wrote 63.287208 s. At 1% it was 64.161458 s. Difference: 0.874250 s of edge audio gone. On quiet or soft speech, start low and raise only if room noise survives.

Terminal capture: pitfall silence with below-periods 1 yields soxi -D 0.371167 s; 10 percent threshold trim yields 63.287208 s versus 64.161458 s at 1 percent.
Deliberate failures on the same file. 0.371167 s is the below-periods=1 stop. 0.874250 s is how much extra the 10% threshold removed versus 1%.

Batching a few takes

Optional, but useful when you have several short takes in one folder:

for f in take*.wav; do
  sox "$f" "prep_$f" silence 1 0.1 1% reverse silence 1 0.1 1% reverse rate 16k channels 1
done

We cut three 20-second slices from the master, ran that loop, and measured wall time 0.063 s on this box. Outputs were 16 kHz mono at 14.635188 s, 19.869250 s and 19.913125 s.

What we did not test

  • EBU R128 loudnorm. Not claimed. SoX norm / gain are simple peak or gain tools. For integrated LUFS delivery, use the FFmpeg loudnorm review.
  • Audacity noise reduction. Not compared. Our Audacity review covers NR and export on Linux. This article is silence timing and sample-rate prep only.
  • GPU. SoX here is CPU CLI.
  • Windows and macOS package builds. Real room noise, crosstalk, and quiet human speech beyond this TTS fixture. MP3 in/out quality beyond noting that lossy round-trips are a bad idea for a prep step you still need to edit.

Who it suits

SoX suits a creator who already pastes FFmpeg or whisper commands and wants one local prep pass before those tools. It is a poor fit if you need visual waveform editing, restorative noise reduction, or a delivery loudness number. For that last job, loudnorm. For captions after this prep, whisper.cpp.

Sources and evidence

Commands, soxi dumps, the fixture layout, synthetic -l proof and the full command log are in ToolBrivio's evidence archive for this review (sox-interview-audio-prep, October 30, 2026). The pages below showed us which silence recipes to test. Every duration above comes from our own runs.

The ToolBrivio digest

Better software choices, in your inbox.

A weekly selection of software reviews and practical guides. Launching soon — leave your email to join the waitlist.