Load Audio FilePath to Audio Info
Audio info from a dropdown picker, for when you'd rather not wire a loader
- duration
- sample_rate
- channels
- metadata
ExtractAudioInfo needs an AUDIO output wired into it. LoadPathToAudioInfo is the same idea with training wheels: instead of accepting a wire, it gives you a dropdown of the audio files sitting in ComfyUI's input/ folder and reads the info straight off the one you pick. Same four outputs - duration, sample_rate, channels, and metadata - none of the graph plumbing.
Here's how it works, because the mechanism determines the gotchas. When the node is created, it scans ComfyUI's input directory and filters for .wav, .mp3, .flac, and .ogg files, and those become the choices in the audio_file_name dropdown. Pick one and it resolves the full path, reads it with soundfile's info call, and returns duration (frames ÷ sample rate), sample rate, channel count, and a metadata dict noting the source, format, and subtype.
Two practical consequences fall straight out of that design:
The dropdown is a snapshot, not a live folder view. The file list is captured when the node is created. Drop a new audio file into input/ after adding the node and it won't appear in the list until you re-add the node (or reload the workflow). Get in the habit of putting the file in input/ before you place the node.
MP3 support is conditional. The node happily lists .mp3 files, but reading them goes through soundfile/libsndfile, and libsndfile's MP3 decoding depends on your build. Most modern installs handle it; some don't. If a particular MP3 reads as garbage or errors while a WAV of the same audio works, that's the wall you've hit - convert to WAV or FLAC and move on rather than debugging the node.
That's the whole thing. It's genuinely handy for quick checks - "how long is this track?" without hunting through loader settings - and the outputs plug straight into this pack's CalculateVideoFrameCount if you're syncing video length to audio. It's not a loader replacement: no waveform comes out, only numbers.
Installs with the rest of ThimPatUtils (ComfyUI Manager, search "Multimedia Utilities", or git clone https://github.com/thimpat/ThimPatUtils into custom_nodes/). It depends on soundfile, and remember the pack ships no requirements.txt despite what the README says - if the audio nodes are missing entirely, python -m pip install soundfile opencv-python and restart fixes the whole pack at once.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| audio_file_name | COMBO | 0 options: |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| duration | FLOAT | — |
| sample_rate | INT | — |
| channels | INT | — |
| metadata | DICT | — |