Audio Trim Silence (dB)
The simple dB silence trimmer, with a mode that picks the threshold for you
- audio
- audio
- decibel
Audio Trim Silence (dB) is the plain, honest half of Audio General's two silence trimmers, and it's named for the library that does the actual work: librosa. It trims the leading and trailing silence off an AUDIO clip - the dead air before a voiceover starts, the room-tone tail after it ends - and it does it with a straightforward decibel threshold instead of a voice activity detector. That makes it fast, predictable, and perfectly happy with music or foley, which is where the pack's other trimmer (the VAD one) sometimes gets twitchy. From niknah's audio-general-ComfyUI pack.
How it works
The node runs librosa.effects.trim, which measures each part of the clip against the loudest moment and cuts off anything quieter than a top_db threshold. If the peak is 0 dB, a threshold of 20 dB means everything below -20 dB relative to that peak gets trimmed from the ends. Two knobs, two modes, and the tooltips make the rule explicit: use one, not both.
decibel(default 0) - a fixed threshold. Set it to something like 20–40 dB and it trims to exactly that floor. 0 means disabled.bins(default 7) - the clever mode. It computes a histogram of the clip's STFT magnitudes acrossbinsbuckets, takes the middle bucket, and converts that into a decibel threshold for you. More bins means a lower detected threshold, which means more of the audio gets trimmed. It's the mode that's on by default, and it's the one that saves you from guessing.
The outputs
Two, and one is a nice touch: audio (the trimmed AUDIO), and decibel - a FLOAT with the exact threshold that was used. The catch, per the tooltip, is that the decibel output is only meaningful in bins mode, where it tells you what the auto-detection actually chose. Leave it unwired if you don't care; it's there so you can read it, tune bins, and build intuition for your own audio.
Install
Standard for the pack: ComfyUI Manager → search "Audio General" → install, or
cd ComfyUI/custom_nodes
git clone https://github.com/niknah/audio-general-ComfyUI
Restart ComfyUI. librosa is one of the pack's four pip dependencies (torchaudio, librosa, torch-time-stretch, audiostretchy) and it's the heavyweight of the bunch - it drags in numba and scipy, so the first install takes a little longer than the pack's size suggests. No models to download, runs on CPU.
Where people get burned
Two small things. First, remember it only trims the ends - it won't remove pauses between sentences, and there's no setting that makes it. Second, don't zero out both inputs: if decibel is 0 and bins is 0, the threshold collapses and librosa will happily trim the whole clip to near-silence. Keep one of them active and this node is about as foolproof as audio processing gets. If your material is noisy speech rather than clean audio, the VAD trimmer handles that better; for everything else, this is the one to grab.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | — | |
| decibelopt | FLOAT | 0.00 | Either use decibel or bins, not both. Set to 0 to disable. |
| binsopt | INT | 7 | Bins will detect the decibel based on the middle bin. Should be an odd number. The more bins the lower the decibel and more of the audio will be trimmed. Set to 0 to disable. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | Audio |
| decibel | FLOAT | Decibel number used only useful if you're using bins. |