XB-BOX - 🎵 音频切片V2(双人)
Stitch two voice clips into one track, gap and all
- combined_audio
- total_frames
- fps
- audio1
- frames1
- audio2
- frames2
Two-person dialogue is where single-file slicing stops being enough. You have Speaker A's line and Speaker B's line as two separate recordings, and what you actually need for the video is one continuous audio track: A speaks, a beat of silence, B speaks. XB_AudioSlicerV2 is purpose-built for exactly that - two independent slices plus a gap_frames gap, all merged into a single AUDIO output with a total frame count you can feed straight to a video model.
This is the "双人" (two-person) node in XB_ToolBox's audio-slicer family. If you've ever faked a two-voice track by rendering two videos and praying they sync, this replaces the whole dance.
How it works
Each of the two inputs gets the same treatment as the single slicer: decode, mono downmix, clamp your start/end to the file, and snap the frame count to the 4N+1 rule video models like Wan expect. Then the node:
- Cuts
audio1betweenstart1/end1. - Cuts
audio2betweenstart2/end2. - Inserts a silent gap of
gap_framesframes between them (default 25 - one second at the default fps). - Concatenates the three pieces and reports the total in frames.
Because every segment is individually 4N+1-snapped and the gap is expressed in frames, the combined track is a clean, deterministic length. No floating-point drift between the audio samples and the video's frame counter.
The inputs that matter
- audio1 / audio2 - dropdowns of files in
ComfyUI/input. Drop both recordings there. - start1 / end1, start2 / end2 - per-speaker in/out points in seconds.
- gap_frames - the pause between speakers in frames, default 25 (1s at 25fps). Raise it for a more conversational pause, lower it to 0 for back-to-back lines.
- fps - default 25. Shared across both slices and the gap.
Outputs worth naming: combined_audio (the merged track), total_frames (INT), fps, and then per-speaker audio1/frames1 and audio2/frames2 - the individual slices, in case you want to do anything else with them separately. The total_frames output is what you wire into a segment_length input.
Installing
It's in XB_ToolBox - install the pack once and the whole family appears. ComfyUI Manager, search XB_ToolBox, or:
cd ComfyUI/custom_nodes
git clone https://github.com/WJLUOXIAO/XB_ToolBox.git
then restart. PyAV (av) handles decoding; it's in the pack's requirements.txt and normally already installed.
Common issues
- Only one voice in the output - check you didn't leave one audio dropdown on
none; that silently produces an empty slice. - Gap feels wrong -
gap_framesis in frames, not seconds. At 25fps, 25 frames = 1 second. At 24fps it's slightly longer, so the number is not "seconds." - Voices overlap or start too late - double-check
start2/end2against the second file's own timeline, not the combined one.
The honest limitation: V2 is relay-only, A then B, one gap. If you need per-track silences inside a line (drop a word, mute a section) or an actual overlap between voices, V3 is the advanced variant that adds mute regions and a merge mode.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| audio1 | COMBO | 1 options: none | |
| fps | FLOAT | 251–120 | — |
| start1 | FLOAT | 0.000–99999 | — |
| end1 | FLOAT | 10.000–99999 | — |
| audio2 | COMBO | 1 options: none | |
| start2 | FLOAT | 0.000–99999 | — |
| end2 | FLOAT | 10.000–99999 | — |
| gap_frames | INT | 250–99999 | — |
| total_display | STRING | 0 帧 | — |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| combined_audio | AUDIO | — |
| total_frames | INT | — |
| fps | FLOAT | — |
| audio1 | AUDIO | — |
| frames1 | INT | — |
| audio2 | AUDIO | — |
| frames2 | INT | — |