KJNodes/audiogenerated

AudioConcatenate

This node technically takes two audio dictionaries containing waveform data and sampling rates as inputs

Audio Concatenate

audio1
audio2
AUDIO
direction
right
KJNodes

The AudioConcatenate node technically receives two audio dictionaries containing waveform data and sample rates as inputs.

The AudioConcatenate node is an audio processing tool whose core function is to concatenate two audio segments into a longer audio clip. It allows users to specify the order of concatenation, providing flexibility in combining audio materials.

Node Functionality

This node technically receives two audio dictionaries containing waveform data and sample rates as inputs. It first checks if the sample rates of the two audio inputs are consistent; if not, an error will be reported. After confirming that the sample rates match, the node uses PyTorch's torch.cat function to concatenate the waveform data along the width dimension according to the user-selected direction, ultimately outputting a new audio dictionary containing the concatenated waveform and the original sample rate.

Node Parameter Description - AudioConcatenate

Connection Inputs

Parameter NameData TypeRequiredDefault ValueValue Range/OptionsDescription
audio1AUDIOYes--: Input the first audio data to be concatenated.
audio2AUDIOYes--: Input the second audio data to be concatenated.

Control Parameters

Parameter NameData TypeRequiredDefault ValueValue Range/OptionsDescription
directionCOMBOYesright"right", "left": Controls the concatenation order of the two audio segments. Options are "right" (audio1 first, audio2 second) or "left" (audio2 first, audio1 second).

Output

Parameter NameData TypeDescription
AUDIOAUDIO: Outputs the newly concatenated audio data.

Usage Scenarios

In workflows for creating audiobooks or podcasts, you can use this node to sequentially concatenate multiple recorded chapters or segments. For example, by using the opening music as audio1 and the narration content as audio2, and selecting the "right" direction, you can generate a complete audio segment with opening music.

Notes

Please note that this node requires the two input audio segments to have the same sample rate; otherwise, processing cannot proceed. The concatenation operation is performed only along the time dimension and does not involve any mixing or overlapping of the audio content.

The AudioConcatenate node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…