Nodes/ComfyUI_Local_Media_Manager/Select Original Audio
ComfyUI Node

Select Original Audio

Slice the exact audio clip you need out of your media library, in seconds

By Firetheft·Created about a year ago·Updated 9 months ago· 143
Select Original Audio
  • paths
  • audio
  • duration
index0
seek_seconds0.00
duration0.00

Audio is the least developed corner of ComfyUI - models are thin, nodes are scattered, and the ecosystem is basically held together by a few packs plus the core AUDIO type. Which is exactly why a node that just loads and trims an audio file cleanly is quietly useful. Select Original Audio picks one audio file from your Local Media Manager multi-select, cuts a segment by start time and duration, and hands you a ready-to-use AUDIO tensor. No file-path archaeology, no hand-rolling an ffmpeg command.

How it works

Wire the gallery's paths output in, set index to the audio file's sequence number, and the node decodes it by shelling out to ffmpeg, which converts whatever you give it to float32 PCM at 44.1kHz stereo. The result is wrapped in ComfyUI's standard AUDIO format - a waveform tensor plus a sample_rate - so it plugs into any audio node in the graph. Trimming is done in the same pass: seek_seconds becomes an ffmpeg -ss start offset and duration a -t length. If the source is a video file with an audio track, it works too - the decoder just strips the video stream.

The inputs that matter

Only four, and only two you'll touch regularly:

  • paths - from the gallery's paths output. Required.
  • index - which selected file to use, 0-based.
  • seek_seconds (FLOAT) - where the clip starts, in seconds. 0 = beginning of the file; supports decimal steps (0.01).
  • duration (FLOAT) - how long the clip is. 0 means "to the end of the file," not "zero seconds." Set it to grab a fixed-length segment.

Outputs

  • audio (AUDIO) - the trimmed segment. Core SaveAudio writes it to disk, or it feeds anything that consumes audio: an audio-to-video model like ACE-Step or MMAudio, a lip-sync pipeline, a reference clip for a TTS workflow.
  • duration (FLOAT) - the actual loaded duration in seconds (what you got, not what you asked for). Feed it into a node that needs to know the clip length - handy when you trimmed near the end of a file and the real length is shorter than duration requested.

Common issues

  • ffmpeg must be installed. This is the one that bites people: the README talks up torchaudio, but the actual decode is a subprocess call to the ffmpeg binary. ComfyUI Desktop bundles it; on a manual Python install you'll get "could not extract audio" errors until you put ffmpeg on your PATH.
  • Silent fallbacks instead of errors. A file with no decodable audio returns a 1-frame silent clip rather than raising. If your pipeline suddenly has no sound, check the source file actually contains audio.
  • Supported formats are mp3, wav, ogg, flac, m4a. Anything else the gallery won't even show as selectable audio.
  • Bad seek_seconds past the end of the file gives you a silent/short clip, not a crash - the duration output is your tell.

Install via ComfyUI Manager (search "Local Media Manager") or git clone https://github.com/Firetheft/ComfyUI_Local_Media_Manager into custom_nodes/, then pip install -r requirements.txt and restart. The pack's real deps are torchaudio, opencv-python-headless, and send2trash - and, again, the ffmpeg binary for this node's actual work.

Category📜Asset Gallery/Local

Inputs (4)

NameTypeDefaultDescription
pathsLMM_ALL_PATHS
indexINT0
seek_secondsFLOAT0.000–100000
durationFLOAT0.000–100000

Outputs (2)

NameTypeDescription
audioAUDIO
durationFLOAT