Nodes/MKRShift_Nodes/Load Audio Metadata
ComfyUI Node

Load Audio Metadata

Sample rate, channels, duration, codec

By criskb·Created 7 months ago·Updated 5 months ago· 0
Load Audio Metadata
  • audio
  • audio
  • sample_rate
  • channels
  • duration_sec
  • metadata_json
audio_path

The node that reads your audio's vitals

You're about to normalize, denoise, or mux some audio, and the first thing you need to know is what you're working with. What sample rate? Stereo or mono? How long? What codec? MKRLoadAudioMetadata answers all of that before you do anything destructive - it's the audio equivalent of opening the file properties dialog, except the answers come out as wireable values instead of a popup you have to eyeball.

It's part of MKRShift_Nodes, the big utility-and-finishing pack by Cris K B. No models, no API, no extra pip packages - it reads metadata with ffprobe, so the one real dependency is having ffmpeg installed and on your PATH.

How it works

You give it either an audio_path (a string pointing at a file) or an already-connected audio object (the pack's MKR_AUDIO type, or anything the pack can resolve to a file). If a file is found it runs ffprobe, pulls the audio stream info, and hands it back as structured values. If you feed it an in-memory waveform instead, it falls back to computing sample rate, channels, and duration directly from the samples. If neither resolves, you get zeros and a warning in the metadata - no crash, just a clear "no audio input found".

The outputs

Five of them, and the naming is honest:

  • audio - the same MKR_AUDIO payload, passed through so you can chain this node in the middle of a graph without breaking the wire.
  • sample_rate, channels, duration_sec - the numbers you'll actually branch on.
  • metadata_json - a JSON string with the full picture: path, bitrate, codec name, duration, sample rate, channels, plus any warnings.

The payload pass-through is worth calling out because it's the pack's pattern: MKR_AUDIO and MKR_VIDEO are MKRShift-native types. A stock ComfyUI node won't know what to do with them - you feed them to other MKR audio nodes, not to the built-in ones.

Why you'd actually reach for it

Real talk: this is a supporting node, not a headline one. You use it to gate a workflow - "if this file isn't 48kHz stereo, resample it first" - or to log what you're about to process. It shines in batch pipelines where you're chewing through a folder of audio and want the metadata in metadata_json for a report or manifest node. On its own it does nothing visible, but it's the kind of plumbing that keeps a media pipeline honest. The pack groups it under Media/IO for a reason.

Install and gotchas

cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes

Then restart ComfyUI - or install "MKRShift Nodes" via ComfyUI Manager. No pip step, no model downloads. The one thing that will bite you: if ffmpeg isn't on your PATH, the node can't run ffprobe and you'll get an empty read instead of an error, which is a confusing place to debug from. On Windows, install ffmpeg and make sure the bin folder is on PATH before you blame the node. And remember the MKR_AUDIO output is pack-internal - if you're trying to hand audio to a non-MKR node, that's a type mismatch, not a bug.

CategoryMKRShift Nodes/Media/IO

Inputs (2)

NameTypeDefaultDescription
audio_pathSTRING
audioopt*

Outputs (5)

NameTypeDescription
audioMKR_AUDIO
sample_rateINT
channelsINT
duration_secFLOAT
metadata_jsonSTRING