
74.399729 s at 48000 Hz mono. Step 3: reverse head/tail trim landed at 64.161458 s. Step 4: mid-pause -l leave 2.0 reached 58.092375 s. Step 6: rate 16k channels 1 kept that duration at 16000 Hz. Step 7: below-periods=1 failed at 0.371167 s. Monospace lines are copied from our lab log. Not a GUI.We have a finished VO or interview take, whisper.cpp or FFmpeg loudnorm is next, and we do not want to open a GUI just to cut dead air. This Guide is the SoX CLI pass we now run: confirm the build, soxi the input, trim head and tail only, compress long mid pauses with a leave gap, land a 16 kHz mono WAV, then deliberately FAIL the two silence traps. About nine steps. Each one has a command and a PASS, FAIL, or HOLD call.
Numbers, recipe notes and the full silence write-up live in the companion review: SoX review: trim interview dead air and land a 16 kHz mono WAV before whisper. We do not repeat that scoreboard here.
Test note: October 30, 2026, Asia/Shanghai, Debian GNU/Linux 13 (trixie), KVM guest with 8 CPUs. SoX v14.4.2 (Debian sox / libsox3 14.4.2+git20190427-5+b3). FFmpeg 7.1.5 built the fixture and cross-checked silence. The test file is our own: Piper TTS voice-over plus digital silence we added (no music bed, no third-party audio). Input soxi -D 74.399729, 48000 Hz, 1 channel, 7,142,452 B. It is not real quiet-room speech.
The checklist
Persona: a creator who wants CLI prep before whisper.cpp or loudnorm, and who keeps hitting silence-effect grammar and threshold traps. Run the steps in order. Steps 7 and 8 are deliberate FAIL patterns: run them once on a copy so you recognize the damage.
| Step | PASS | FAIL | HOLD |
|---|---|---|---|
| 1. SoX version | sox --version prints SoX v14.4.2 (or your installed build) | Command missing; wrong binary | Windows / macOS builds (not tested) |
| 2. soxi input | Duration, rate, channels, bits recorded (ours: 74.399729 s, 48000, 1 ch, 16-bit) | Skipping the read and guessing length | |
| 3. Head+tail trim | Duration drops by head+tail only; mid pauses remain (ours: 64.161458 s; mids 3.237646 / 4.212042 s) | Mids gone, or duration barely moved | |
| 4. Mid leave 2.0 | Duration falls further (ours: 58.092375 s); leave 2.0 is our threshold | File emptied or speech chewed | Real quiet speech beyond TTS (not tested) |
| 5. Optional leave 0.5 | Measured duration noted (ours: 55.443208 s); leave 0.5 is ours | Delivery pauses feel clipped | Skip if 2.0 already fits the cut |
| 6. 16 kHz mono | soxi -r 16000 and -c 1 (ours: Duration 58.092375 s) | Still 48000 or multi-channel | Clip warnings without a listen pass |
| 7. Pitfall stop | You recognize the FAIL: below-periods=1 form yields a stub (ours: 0.371167 s) | Shipping that stub as the prep file | |
| 8. Pitfall 10% | You note the extra bite vs 1% (ours: 63.287208 vs 64.161458; delta 0.874250 s) | Defaulting to 10% on quiet speech | Room noise floors (not tested) |
| 9. Batch takes | Each prep file is 16 kHz mono; wall time noted if you care (ours: 0.063 s for 3 takes) | One take still 48 kHz | Huge folders / network disks (not tested) |
1. Confirm SoX version
sox --version
soxi -h | head -n 2
nproc
PASS when sox --version prints a SoX line you can cite later. Our lab: SoX v14.4.2 on an 8-CPU KVM guest. Note: soxi --version on this build printed a getopt warning and the same version string; prefer sox --version for the cite.
- [ ] SoX version written down
- [ ] Core count noted (we had 8)
2. soxi the input
soxi interview.wav
soxi -D interview.wav
soxi -r interview.wav
soxi -c interview.wav
soxi -b interview.wav
stat -c '%s bytes' interview.wav
Our master read: Duration 74.399729 s, Sample Rate 48000, Channels 1, Precision 16-bit, size 7,142,452 B. PASS when those four facts are on the page before you rewrite the file.
- [ ] Duration, rate, channels, bits recorded
- [ ] Working on a copy, not the camera card dump
3. Head+tail trim only (keep mid pauses)
sox interview.wav trim_ends.wav silence 1 0.1 1% reverse silence 1 0.1 1% reverse
soxi -D trim_ends.wav
Read it as: wait for 0.1 s above 1% full scale, drop everything before that, reverse, do the same for the new front (old tail), reverse back. On our file: 64.161458 s (removed 10.238271 s). FFmpeg silencedetect still saw the two mid gaps at 3.237646 s and 4.212042 s. PASS when duration drops by head+tail and the mid pauses remain. The reverse chain is the head/tail-only form we took from the archived Stack Overflow note in the SoX review; Digital Cardboard documents the same reverse pattern.
- [ ]
soxi -Dshorter than the input - [ ] Mid pauses still audible / still detected
4. Mid-pause compress with leave gap 2.0
sox interview.wav mid_2s.wav silence -l 1 0.1 1% -1 2.0 1%
soxi -D mid_2s.wav
-l means leave a gap; the negative below-periods restarts detection through the file. 2.0 is our working leave value, not an industry standard. Use a trailing .0 so SoX does not treat a bare integer as a sample count. Our VO landed at 58.092375 s (removed 16.307354 s from the input).
TTS soft-edge caveat: on this VO, a strict -50 dB / 1.0 s detector did not show a remaining ≥1 s gap after the leave-2.0 pass, even though duration fell. On a clean synth gap file (14.000000 s in) the same recipe wrote 8.039417 s with two leftover gaps of 2.019854 s. Trust soxi -D, listen once, then move on. Man page semantics for silence [-l] are archived in the review sources.
- [ ] Duration fell past the trim-ends value
- [ ] Leave gap labeled as ours (2.0)
- [ ] Quick listen for chewed soft onsets
5. Optional tighter leave-gap 0.5
sox interview.wav mid_0.5s.wav silence -l 1 0.1 1% -1 0.5 1%
soxi -D mid_0.5s.wav
Our measured duration: 55.443208 s. 0.5 is also our threshold. HOLD if the 2.0 leave already fits the cut; FAIL if delivery pauses feel clipped when you listen.
- [ ] Duration written down, or step skipped on purpose
6. Rate + channels to 16 kHz mono
sox mid_2s.wav -r 16000 -c 1 -b 16 interview_16k_mono.wav rate 16k channels 1
soxi -r interview_16k_mono.wav
soxi -c interview_16k_mono.wav
soxi -D interview_16k_mono.wav
PASS when soxi -r prints 16000 and -c prints 1. Ours kept Duration 58.092375 s. Logged warnings: rate clipped 7 samples, dither clipped 5 samples. We did not score audible damage; note the warnings and listen to a short stretch before handoff.
- [ ] 16000 Hz, 1 channel
- [ ] Clip warnings noted if present
7. Pitfall: below-periods=1 stops at first mid silence
sox interview.wav pitfall_stops.wav silence 1 0.1 1% 1 0.1 1%
soxi -D pitfall_stops.wav
This is a FAIL pattern to avoid. On our file: 0.371167 s. The below-periods=1 form stops when it hits the first mid silence instead of walking the whole file. Do not ship that stub. Prefer step 3 (reverse chain) or step 4 (-l with negative below-periods).
- [ ] Ran on a copy; recognized the stub duration
- [ ] Prep path does not use this form
8. Pitfall: 10% threshold vs 1%
sox interview.wav pitfall_10pct.wav silence 1 0.1 10% reverse silence 1 0.1 10% reverse
soxi -D pitfall_10pct.wav
# compare to the 1% trim_ends duration
Ours: 10% trim 63.287208 s vs 1% 64.161458 s; delta 0.874250 s. That extra bite is the quiet-speech risk. We started at 1%. sox_ng issue #395 (archived in the review) flags threshold edge cases that can empty a file; we did not reproduce an empty output at 1% or 10% on this fixture.
- [ ] Delta vs 1% noted before raising the threshold
- [ ] Quiet onsets checked by ear after any threshold change
9. Batch a few takes
mkdir -p batch
# example: three short takes, then trim ends + rate 16k
for f in batch/take*.wav; do
sox "$f" "batch/prep_$(basename "$f")" \
silence 1 0.1 1% reverse silence 1 0.1 1% reverse \
rate 16k channels 1
done
for f in batch/prep_*.wav; do
printf '%s ' "$f"; soxi -D "$f"; soxi -r "$f"; soxi -c "$f"
done
Our three prep takes: Duration 14.635188 / 19.869250 / 19.913125 s, each 16000 Hz mono. Batch wall time for the prep loop: 0.063 s on this box. PASS when every prep file is 16 kHz mono. hyaline.systems (archived in the review) covers similar soxi / rate / batch loops.
- [ ] Each prep file: 16000 / mono
- [ ] Wall time noted if you care about scale
What we saw
All from our October 30, 2026 lab log (evidence/sox-interview-audio-prep/). Same 74.399729 s fixture unless noted.
| Step | What we saw | Call | Where in the evidence |
|---|---|---|---|
| 1 | sox --version -> SoX v14.4.2; 8 CPUs | PASS | commands.log env; NOTES Environment |
| 2 | soxi -D 74.399729; -r 48000; -c 1; 7,142,452 B | PASS | commands.log info input |
| 3 | trim_ends 64.161458; removed 10.238271; mids 3.237646 / 4.212042 | PASS | trim head+tail; summary silencedetect TRIM_ENDS |
| 4 | mid leave 2.0 -> 58.092375; synth 14.000000 -> 8.039417; gaps 2.019854 x2 | PASS (duration); caveat on TTS soft edges | mid pause compress; synth_l2 lines |
| 5 | mid leave 0.5 -> 55.443208 | PASS if you want tighter; else HOLD/skip | mid_compress_0.5s soxi -D |
| 6 | 16000 / 1 ch / 58.092375; rate clipped 7, dither clipped 5 | PASS with warnings noted | rate 16k mono WAV |
| 7 | silence 1 0.1 1% 1 0.1 1% -> 0.371167 | FAIL pattern | pitfall_stops_at_mid |
| 8 | 10% 63.287208 vs 1% 64.161458; delta 0.874250 | FAIL to default 10% on quiet speech | pitfall_aggressive vs pitfall_fixed |
| 9 | prep D 14.635188 / 19.869250 / 19.913125; wall 0.063 s; all 16000/mono | PASS | batch for-loop; SUMMARY batch prep |
For the longer recipe notes and the source pages we opened, read the full SoX review.
Download the checklist
Download the SoX audio prep checklist (Markdown). Paste the commands, mark PASS / FAIL / HOLD, and keep the soxi numbers next to each step before the WAV leaves your machine.
FAQ
Why did my silence command stop at the first mid pause?
You likely used below-periods=1 without a reverse chain, as in silence 1 0.1 1% 1 0.1 1%. On our file that wrote soxi -D 0.371167 s and stopped at the first mid silence. Prefer the reverse head/tail form, or mid compress with -l and a negative below-periods.
Is leave-gap 2.0 seconds an industry standard?
No. 2.0 s and the tighter 0.5 s leave values are our working thresholds for this lab, not a delivery standard. On our VO, -l with 2.0 landed at 58.092375 s and 0.5 at 55.443208 s. Pick a leave gap by ear, then lock soxi -D.
Why did -l leave ~2 s on the synth file but not on the TTS VO?
Hard digital silence keeps a clean rectangle. On our synth gap file (14.000000 s in, 8.039417 s out), FFmpeg still saw two gaps of 2.019854 s. Soft TTS edges sit near the 1% threshold, so a strict -50 dB detector may not see a full leftover gap even when soxi -D fell to 58.092375 s. Trust soxi and listen once.
Do I need SoX before whisper.cpp?
Only if the take still has head/tail dead air or long mid pauses you want shortened first. Our handoff file is 16 kHz mono WAV at 58.092375 s. Next gates live in the whisper.cpp first-draft SRT checklist; loudness is a separate FFmpeg loudnorm checklist.
Is rate 16k channels 1 always silent?
Not in our run. From the mid-compress file we saw sox WARN rate: rate clipped 7 samples and dither clipped 5 samples. soxi still reported Sample Rate 16000, Channels 1, Duration 58.092375 s. Note the warnings; we did not measure audible damage.
Honest limits
- One TTS voice-over with digital silence we added. No real quiet-room speech, accents, crosstalk, or music bed.
- EBU loudnorm, Audacity noise reduction, and GPU paths were not tested. Loudness is a separate FFmpeg job.
- Windows and macOS SoX builds were not tested.
- Leave gaps 2.0 and 0.5, and the 1% threshold, are our working values, not platform rules.
- Rate/dither clip warnings appeared (7 / 5 samples on the main 16 kHz write). We did not measure a listening %.
- MP3 quality deep dive: not tested. We hand off WAV.
Evidence: evidence/sox-interview-audio-prep/ (NOTES, commands.log, outputs), October 30, 2026. Every number on this page appears there.
Sources we opened
- SoX man page (silence effect)
- Digital Cardboard: The SoX of Silence
- Stack Overflow: stripping silence with SoX
- Stack Overflow: trim mid-file silence
- Super User: SoX silence while recording
- hyaline.systems SoX guide
- sox_ng issue #395: silence threshold edge cases
Next: hand the 16 kHz mono WAV to the whisper.cpp first-draft SRT checklist, or to the FFmpeg loudnorm delivery checklist, without expanding those workflows here.