Nodes/WAS Node Suite v3/Audio Metadata
ComfyUI Node Runs on cloud

Audio Metadata

How long is the music, and is it even loud enough?

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
Audio Metadata
  • audio
  • duration
  • sample_rate
  • channels
  • samples
  • batch_size
  • is_silent
  • peak
  • rms
  • summary
silence_threshold0.0000

Video workflows keep colliding with a question the graph can't answer: how long is this audio? You loaded a track to score a render and you want the frame count to come out exactly the length of the music. Or you're about to encode a video whose audio track might be silent - and you'd rather know before you burn the encode. Audio Metadata is the node that unpacks an AUDIO value into plain numbers.

Under WAS Suite/IO, it takes an audio input (from Load Video (Advanced), Load Video (Upload), or any node with an AUDIO output) and reads the bundle the way ComfyUI stores sound: a waveform tensor plus its sample rate. What it hands back is a full instrument panel:

  • duration - seconds one clip plays (samples ÷ sample rate). Feed it to a frame count and a render comes out the length of the music. This is the headline output.
  • sample_rate - samples per second: 44100 for CD audio, 48000 for most video. Compare two tracks before mixing clips that won't line up.
  • channels - mono (1) or stereo (2).
  • samples - raw sample count per channel. At 48000 Hz, 480000 samples is ten seconds.
  • batch_size - how many clips are stacked in this AUDIO. A loader answers 1; more means something upstream stacked several.
  • is_silent - true when the loudest sample is at or below your silence_threshold, and also true when nothing readable arrived at all.
  • peak - the loudest single sample anywhere, as distance from zero: 0.0 is silence, 1.0 is full scale, above 1.0 means it will clip when written out.
  • rms - the average level on the same 0.0–1.0 scale. RMS is what sounds loud: mastered music sits near 0.2, a quiet dialogue take nearer 0.02, so a pair of tracks with similar peaks can still read very differently here.
  • summary - the whole reading as one line (44100 Hz, 2 ch, 132300 samples, 3.000 s, batch 1, peak 0.813, rms 0.204), with , silent appended when it is, or no audio when nothing readable arrived. The same text is drawn on the node itself, since it's an output node.

The one setting, silence_threshold (0.0–1.0, default 0.0), decides what counts as silence. 0.0 means only a track silent to the last bit counts; nudge it to 0.001 (about −60 dBFS) and it also catches a noise floor or a tail of dither. Sample values run 0.0 to 1.0, so think of this as a small decimal, not a percentage.

The design choice that makes it useful

A load that found no sound doesn't error - it answers zeroes and is_silent true, and keeps running. That's deliberate, and it's what makes this a branch node rather than a crash point: wire is_silent into a switch or a gate and a graph can skip an encode that would only write a silent track, or route in a music bed when the source turned out mute. And duration wired into a frame-count calculation is the whole "video matches the music" trick - no more guessing frames, re-rendering, discovering the beat lands in the wrong place.

The peak output doubles as a loudness health check: if peak reads above 1.0, the track will clip when it's written, and catching that at this node beats discovering it in the finished file.

Installing

Part of WAS Node Suite v3 (WASasquatch/was-node-suite-comfyui), WASasquatch's MIT pack - going since 2023, over a million downloads, and one of the packs that's been in the ecosystem's essentials conversation from the start. Audio metadata reads the AUDIO value ComfyUI already holds - no extra packages, no models, nothing downloaded. Requires ComfyUI 0.14.0+ (the v3 suite targets ComfyUI's newer node backend).

Via ComfyUI Manager, search WAS Node Suite v3, or clone:

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui

Restart ComfyUI and it appears under WAS Suite/IO. If a video load answers nothing on its AUDIO socket, that usually means the file has no sound track at all - which this node will happily report as silence rather than an error. If the node itself is missing after install, update ComfyUI first.

CategoryWAS Suite/IO

Inputs (2)

NameTypeDefaultDescription
audioAUDIOThe sound to measure, from Load Video (Advanced), Load Video (Upload) or any node with an AUDIO output. A file with no sound track answers nothing on that socket, which reads here as zeroes rather than an error.
silence_thresholdFLOAT0.00000–1How loud the loudest sample may be and still count as silence. 0.0 = only a track that is silent to the last bit; 0.001 is about -60 dBFS and also catches a noise floor or a tail of dither. Sample values run 0.0 to 1.0.

Outputs (9)

NameTypeDescription
durationFLOATSeconds one clip plays for, which is samples divided by sample_rate. 0.0 where there is no sound. Feed it to a frame count so a render comes out the length of the music.
sample_rateINTSamples per second the clip was recorded at: 44100 for CD audio, 48000 for most video. 0 where nothing readable arrived. Compare two of them before mixing clips that would not line up.
channelsINTHow many channels one clip holds: 1 = mono, 2 = stereo. 0 where nothing readable arrived.
samplesINTHow many samples each channel of one clip holds. At 48000 Hz, 480000 samples is ten seconds.
batch_sizeINTHow many clips are stacked in this AUDIO. A loader answers 1; more than that comes from a node that stacked several together.
is_silentBOOLEANTrue when the loudest sample sits at or below silence_threshold, and true for a missing or unreadable AUDIO. Wire it into a switch to skip an encode that would only write a silent track.
peakFLOATThe loudest single sample anywhere in the batch, as a distance from zero: 0.0 = silence, 1.0 = full scale, above 1.0 = clipped when it is written out. Use it to catch a take that needs the level pulled down.
rmsFLOATThe average level across the whole batch, on the same 0.0 to 1.0 scale as peak. It tracks how loud something sounds far better than peak does: music mastered loud sits near 0.2, a quiet dialogue take nearer 0.02.
summarySTRINGThe whole reading as one line, `44100 Hz, 2 ch, 132300 samples, 3.000 s, batch 1, peak 0.813, rms 0.204`, with `, silent` on the end where it is. `no audio` where nothing readable arrived. The same text is drawn on the node.