ComfyUI Node

✂️ VRGDG Audio Crop

00'), not raw seconds

By vrgamegirl19·Created about a year ago·Updated 2 days ago· 717
✂️ VRGDG Audio Crop
  • audio
  • AUDIO
start_time0:00
end_time1:00

Every music-video workflow eventually needs a "just the chorus, please" trim, and most audio nodes make you type decimal seconds. This one lets you type 1:23 and mean it. VRGDG_AudioCrop cuts an AUDIO input between a start_time and end_time given as MM:SS strings - default 0:00 to 1:00 - and returns the trimmed clip. It's the human-friendly crop in the VRGameDevGirl pack, sitting alongside VRGDG_AudioCropTime which does the same job in float seconds.

How it works

The timecodes are parsed as minutes:seconds (with SS.xx decimals accepted, so 0:12.5 works), converted to sample offsets against the audio's own sample rate, and the waveform is sliced. It clamps out-of-range values instead of erroring - an end time past the end of the file just crops to the last sample, and negative values get floored at zero. If you type a plain number without a colon, it prepends 00: and treats it as seconds.

Output is a single AUDIO slot carrying the same format as the input. Nothing is resampled or normalized here - that's VRGDG_CleanAudio's job further down the pipeline. If you feed this node 48kHz stereo, you get 48kHz stereo, just shorter.

The two-crop decision

The pack ships both VRGDG_AudioCrop (string timecodes) and VRGDG_AudioCropTime (float seconds). The difference is genuinely just ergonomics. Timecodes win when you're working from a DAW or a lyric sheet where times are written as m:ss; floats win when you're driving the crop from another node's computed value, since wiring a STRING output into a numeric input doesn't work. Most graphs end up using whichever matches their data source - neither is "better," they're two input shapes for the same operation.

Gotchas and install

The parsing is deliberately lenient but not clever: it expects minutes:seconds, and a value like 1:60 will produce a crop that ends before it starts (the code slices and you get an empty/truncated clip). Keep your timecodes sane. Also note the end_time is exclusive - a 0:00 to 1:00 crop is exactly one minute, not 60.0001 seconds of accumulated drift.

Install: ComfyUI Manager → search "vrgamedev", or cd ComfyUI/custom_nodes && git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl, restart. No models, and this specific node doesn't even need the pack's heavier dependencies - it's plain tensor slicing. If the pack's requirements (kornia, librosa, imageio) fail to install on your setup, this is one of the nodes that still works, but installing them anyway keeps the rest of the graph happy.

Categoryaudio

Inputs (3)

NameTypeDefaultDescription
audioAUDIO
start_timeSTRING0:00
end_timeSTRING1:00

Outputs (1)

NameTypeDescription
AUDIOAUDIO