ComfyUI Node

VRGDG_AudioCropTime

Crop audio by plain float seconds — the pipeline-friendly trim

By vrgamegirl19·Created about a year ago·Updated 2 days ago· 717
VRGDG_AudioCropTime
  • audio
  • AUDIO
start_time0.00
end_time5.00

The no-frills crop. VRGDG_AudioCropTime takes an AUDIO input plus start_time and end_time as plain float seconds, and returns the trimmed clip. There's no timecode parsing, no format guessing - start_time defaults to 0.0, end_time to 5.0, and it slices exactly those seconds out of the waveform. It's the version of VRGDG_AudioCrop you reach for when the crop points come from another node's calculation rather than from a human reading a lyric sheet.

How it works

The mechanism is about as direct as audio nodes get: start_sample = start_time * sample_rate, end_sample = end_time * sample_rate, and the waveform is sliced samples[start_sample:end_sample]. That means the crop precision is tied to the audio's sample rate - at 48kHz you're choosing 48,000 sample boundaries per second, which is more resolution than any downstream step needs. Output is an AUDIO dict (waveform + sample_rate), same format in, same format out. No resampling, no channel changes, no loudness normalization.

Because the inputs are FLOATs, this node wires cleanly into computed pipelines: hook the end of a beat-scene or a duration-calculating node into end_time and the crop follows automatically when values change. That's the actual reason to prefer it over the string-timecode sibling.

Inputs and gotchas

  • audio - the clip to trim.
  • start_time (float, default 0.0) - where the crop begins, in seconds.
  • end_time (float, default 5.0) - where it ends.

One edge to keep in mind: there's no clamping here. If end_time exceeds the audio's actual length, the slice just runs to the end of the tensor (fine). But if start_time >= end_time, you get an empty clip - the node won't swap them or warn you. Also, if you're trying to crop "0:42" and type 42, you'll get 42 seconds, not 42 minutes - this node lives entirely in decimal seconds.

Install

Same pack install as the rest of this collection: ComfyUI Manager → search "vrgamedev", or git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl into ComfyUI/custom_nodes, restart. No models, no heavy dependencies for this node itself. It's a ten-line utility with a single job - if you want human timecodes, use VRGDG_AudioCrop; if you want numbers wired from the graph, this is the one.

Categoryaudio

Inputs (3)

NameTypeDefaultDescription
audioAUDIO
start_timeFLOAT0.00
end_timeFLOAT5.00

Outputs (1)

NameTypeDescription
AUDIOAUDIO