Nodes/ComfyUI-ElevenLabs-Pro/ElevenLabs Pro - Audio Metadata
ComfyUI Node

ElevenLabs Pro - Audio Metadata

Stop guessing how long your audio is — read it instead

By IxMxAMAR·Created 5 months ago·Updated about a month ago· 1
ElevenLabs Pro - Audio Metadata
  • audio
  • duration_seconds
  • sample_rate
  • channels
  • samples

ComfyUI's AUDIO type is just a dict with a waveform tensor and a sample rate - there's no built-in "how long is this?" node. ElevenLabsPro_AudioMetadata is the three-line solution: it inspects any AUDIO dict and hands you the numbers you'd otherwise have to compute by hand. Pure local, free, instant.

The four outputs are the whole show:

  • duration_seconds - clip length as a float, computed as samples ÷ sample rate.
  • sample_rate - the rate in Hz.
  • channels - mono is 1, stereo is 2, etc.
  • samples - total sample count in the time axis.

Mechanically it just reads the waveform tensor's shape, figures out the channel and time dimensions (it tolerates 1-D, 2-D, and 3-D waveforms, matching the pack's broader "accept anything" audio policy), and does one division. No API call, no key, no credits. Input is audio; that's it.

Where this node earns its keep is when you stop treating it as a readout and start treating it as a decision input. Want to enforce that every narration chunk stays under 15 seconds? Wire duration_seconds into a comparison and branch. Building a subtitled video? Feed duration_seconds into a text node so your export logs real timing. Took a clip out of the API and aren't sure what sample rate you actually got back? This is the node that tells you - and the answer matters, because your downstream concat adopts the first clip's rate and a surprise 16 kHz will drag everything down with it. You can also use it to sanity-check the pack's own outputs: the API can return silence when an empty body comes back, and Metadata is how you'd catch a "1.0 second of silence" result instead of a real take.

It pairs cleanly with the rest of the pack's audio utilities. Trim before you inspect to get accurate boundaries, or inspect first to figure out what to trim. And since it outputs plain numbers, it slots into any arithmetic or routing logic you've already got in the graph - no special handling needed.

Install is the pack standard:

cd ComfyUI/custom_nodes
git clone https://github.com/IxMxAMAR/ComfyUI-ElevenLabs-Pro.git
pip install -r ComfyUI-ElevenLabs-Pro/requirements.txt

Restart ComfyUI, or install "ComfyUI-ElevenLabs-Pro" from ComfyUI Manager. Dependencies are just requests and soundfile; this node needs neither, just torch, which you already have.

The one trap worth naming: a 0-sample or malformed waveform yields duration_seconds = 0.0 rather than an error, so don't treat a zero as a crash - treat it as a signal that upstream didn't produce audio. And remember it reads the dict in front of it, not the file on disk. If you've saved to disk with Save Audio and then re-loaded elsewhere, the metadata is whatever that loader reports, not what this node saw earlier.

CategoryElevenLabs Pro/Utils/Audio

Inputs (1)

NameTypeDefaultDescription
audioAUDIO

Outputs (4)

NameTypeDescription
duration_secondsFLOAT
sample_rateINT
channelsINT
samplesINT