Nodes/fxai-toolkit/凤希AI - 多音频合并
ComfyUI Node

凤希AI - 多音频合并

Glue every segment back into one soundtrack with a single ffmpeg call

By fxai666·Created 4 months ago·Updated 4 days ago· 35
凤希AI - 多音频合并
    • 合并音频
    文件夹路径
    目标采样率44100
    目标声道2

    The whole segmented-video philosophy is generate-in-chunks, stitch-at-the-end - and audio is the part people forget to stitch. FxAiAudioMerge (凤希AI - 多音频合并) is the end of that road for sound: point it at a folder of segment audio files and it concatenates them into one AUDIO, resampled and re-channeled to whatever you ask for. This is your final-mix node, the thing that turns a folder of 000_seg1.wav-style pieces back into a single soundtrack for the finished video.

    How it works

    It lists every audio file in 文件夹路径 (folder path), writes them to an ffmpeg concat list, and runs a single ffmpeg command:

    ffmpeg -f concat -safe 0 -i list.txt -ar <采样率> -ac <声道> -c:a pcm_s16le out.wav
    

    Concatenation is the ffmpeg concat demuxer doing a raw sample-level splice - no crossfades, no silence trimming, no EQ. What you get is exactly your segments, back to back, in filename order. If the folder is missing or empty, it doesn't throw: it returns a silent audio buffer at your requested sample rate and channel count, and logs a clear "directory not found" line. That graceful failure is deliberate - a merge node failing mid-pipeline is worse than returning a few seconds of quiet.

    Inputs

    • 文件夹路径 (folder path) - where the segments live.
    • 目标采样率 (target sample rate) - int, default 44100, range 8000–96000. Set it to whatever your final video container wants; 44100 is the safe default.
    • 目标声道 (target channels) - 1 or 2, default 2.

    The output is one 合并音频 (merged audio) AUDIO, ready to mux onto your finished video.

    Install

    One node in fxai-toolkit (凤希全能节点包), the Chinese MIT-licensed suite by 凤希AI built for segmented low-VRAM video generation. ComfyUI Manager (search "fxai") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/fxai666/fxai-toolkit
    # restart ComfyUI
    

    This node is a straight shell-out to ffmpeg, so ffmpeg must be installed and on PATH - it's the single most likely node in the pack to hit "ffmpeg not found" if your install is incomplete. The pack auto-installs soundfile and psutil; no model files needed.

    Gotchas

    • Order = filename order, period. If your segments are named seg10.wav and seg2.wav, you get 10 before 2. Name them with zero-padded indices (000_, 001_... 010_) - the same convention the pack's FxAiAudioManager uses when it saves.
    • No crossfade. If your segments have room-tone or reverb tails, the seams will be audible. For smooth joints, generate your segments with overlap (the 过渡帧 logic upstream) and accept the seam, or fix it in a real editor afterward.
    • It merges, it doesn't mix. Two segments that should play simultaneously aren't handled here - this is strict serial concatenation, which is right for "one soundtrack after another" workflows like voice-over-per-scene.
    • On a merge failure you get silence, not an exception. If your final video has quiet audio, check the console for the "merge failed" line before debugging anything else.
    Category凤希AI/音频

    Inputs (3)

    NameTypeDefaultDescription
    文件夹路径STRING
    目标采样率INT441008000–96000
    目标声道INT21–2

    Outputs (1)

    NameTypeDescription
    合并音频AUDIO