FolderBatch Load Audio
Load audio by path, and get the duration for free
- audio
- duration_float
- duration_int
Core ComfyUI still treats audio like a guest star, so when you need a real audio file in a graph the loaders are thin on the ground. FolderBatch Load Audio is the path-driven version of that: feed it an audio_path and it decodes the file into a proper AUDIO object - plus two durations it computes while it's in there, duration_float and duration_int, which turn out to be the outputs you didn't know you needed.
The decoding is where a utility node shows its quality. It uses PyAV to open the file, pull the first audio stream, decode every frame, and stack the waveform into a single float tensor. Integer formats get normalized properly - int16 samples divide by 2^15, int32 by 2^31 - so you don't get a waveform that's mysteriously loud or quiet depending on the source format. Multi-channel audio keeps its channels intact rather than collapsing to mono. The result is a standard AUDIO dict with waveform and sample_rate, the same shape ComfyUI's own audio nodes expect, so it plugs straight into downstream processors instead of fighting them.
The duration_float output is simply samples / sample_rate in seconds, and duration_int is that rounded to a whole number. Those matter more than you'd think: if you're aligning audio to video, driving a lip-sync chain, or building a workflow that decides how many frames to generate based on clip length, having duration as a first-class FLOAT/INT output saves you a metadata-probing node.
The single input, audio_path, is a forceInput STRING - wire it from FolderBatch Audio Queue to loop through a folder, or from any node that emits a path. Its three outputs are audio (the AUDIO), duration_float (FLOAT), and duration_int (INT).
Realistic traps: the file must actually have an audio stream - throw a video-only container at it and you'll get a "no audio stream" error rather than silence, which is the correct failure mode but surprising if you expected a fallback. Files with no decodable frames error too. Neither case breaks your graph silently, which is the good kind of strict.
Install is pack-standard: Manager → "ComfyUI-FolderBatch" → restart, no models, and PyAV is already part of ComfyUI. On its own this is a competent "load audio by path" node with a nice duration bonus; wired to its queue sibling it's the tail end of a fully automated audio batch loop.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| audio_path | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |
| duration_float | FLOAT | — |
| duration_int | INT | — |