Nodes/Audio General/Audio Trim Silence (Voice Activity)
ComfyUI Node

Audio Trim Silence (Voice Activity)

Trim the dead air off both ends of a voiceover (Audio Trim Silence VAD)

By niknah·Created about a year ago·Updated 19 days ago· 5
Audio Trim Silence (Voice Activity)
  • audio
  • audio
trigger_level7.00
trigger_time0.25
search_time1.0
allowed_gap0.25
pre_trigger_time0.00
boot_time0.35
noise_up_time0.10
noise_down_time0.010
noise_reduction_amount1.35
measure_freq20.0
measure_smooth_time0.40
hp_filter_freq50
lp_filter_freq6000
hp_lifter_freq150
lp_lifter_freq2000

TTS and voiceover recordings almost always ship with a second or two of dead air on the front, and often a trailing tail of room noise after the last word. Audio Trim Silence (Voice Activity) is the smarter of Audio General's two silence trimmers: it uses torchaudio's voice activity detector to find where speech actually starts, then trims both ends so your clip snaps tight around the talking. It's from niknah's audio-general-ComfyUI pack, it takes one AUDIO in and puts one AUDIO out, and if you do any narration-adjacent work it'll quietly save you from the most annoying manual edit in ComfyUI.

How it works

The node calls torchaudio.functional.vad, which is a spectral voice detector - it tracks the noise floor, watches for the signal level to rise past a trigger, and reports where real activity begins. The clever bit: vad only detects the start of speech, so it would leave the tail alone. Audio Trim Silence VAD runs it forward, flips the waveform, runs it again, and flips back - which is how the trailing silence gets trimmed too. Trimming is from the ends only; it will not remove the pauses between sentences inside the clip.

The knobs that matter

The schema lists a wall of parameters, and here's the thing: almost all of them are passed straight through to torchaudio's vad. The defaults are sensible, so a beginner should touch maybe three:

  • trigger_level (default 7) - how much the signal must rise above the noise floor to count as speech. Noisy input eating your first word? Raise it. Quiet speech getting chopped? Lower it.
  • pre_trigger_time (default 0) - seconds of audio to preserve before the detected speech starts. Set it to 0.1–0.3 to stop your voiceovers from sounding like they begin mid-attack.
  • lp_filter_freq (default 6000) - and the author's own tip is right here in the node description: lower this if you have high-frequency background noise (hiss, air conditioning), so the detector stops treating it as signal.

Everything else - trigger_time, search_time, noise_up_time, the lifter frequencies - are fine at their defaults. Tweak them only if you're chasing a specific failure.

Install

The whole pack installs at once. ComfyUI Manager → search "Audio General" → install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/niknah/audio-general-ComfyUI

Restart ComfyUI. Dependencies are torchaudio, librosa, torch-time-stretch, audiostretchy - no model downloads, CPU-only.

Where people get burned

Two things. First, VAD is tuned for speech - feed it a music bed or a clip with weird foley and it can cut in odd places. For plain speech it's the right tool. Second, remember it only trims the ends, not internal gaps. People expect it to tighten up every pause in a narration and it won't - if you want the audio to snap from word to word, that's an editor's job or a different approach. And if the VAD keeps grabbing a loud room-tone hum, that's your cue to drop lp_filter_freq before you touch trigger_level. The pack's other trimmer, Audio Trim Silence (dB), is the simpler, faster, music-friendlier alternative if this one ever feels like too many dials.

CategoryAudio

Inputs (16)

NameTypeDefaultDescription
audioAUDIO
trigger_leveloptFLOAT7.00The measurement level used to trigger activity detection. This may need to be cahnged depending on the noise level, signal level, and other characteristics of the input audio. (Default: 7.0)
trigger_timeoptFLOAT0.25The time constant (in seconds) used to help ignore short bursts of sound. (Default: 0.25)
search_timeoptFLOAT1.0The amount of audio (in seconds) to search for quieter/shorter bursts of audio to include prior to the detected trigger point. (Default: 1.0)
allowed_gapoptFLOAT0.25The allowed gap (in seconds) between quieter/shorter bursts of audio to include prior to the detected trigger point. (Default: 0.25)
pre_trigger_timeoptFLOAT0.00The amount of audio (in seconds) to preserve before the trigger point and any found quieter/shorter bursts. (Default: 0.0)
boot_timeoptFLOAT0.35estimation/reduction in order to detect the start of the wanted audio. This option sets the time for the initial noise estimate. (Default: 0.35)
noise_up_timeoptFLOAT0.10for when the noise level is increasing. (Default: 0.1)
noise_down_timeoptFLOAT0.010for when the noise level is decreasing. (Default: 0.01)
noise_reduction_amountoptFLOAT1.35the detection algorithm (e.g. 0, 0.5, …). (Default: 1.35)
measure_freqoptFLOAT20.0processing/measurements. (Default: 20.0)
measure_smooth_timeoptFLOAT0.40spectral measurements. (Default: 0.4)
hp_filter_freqoptFLOAT50
lp_filter_freqoptFLOAT6000Put this number down if there is high frequency background noise.
hp_lifter_freqoptFLOAT150
lp_lifter_freqoptFLOAT2000

Outputs (1)

NameTypeDescription
audioAUDIO