Nodes/comfyui-AGSoft/🔊✂️AGSoft Audio Split
ComfyUI Node

🔊✂️AGSoft Audio Split

Cut a chunk out of an mp3 without re-encoding it

By Art-xmaster·Created about a year ago·Updated a day ago· 24
🔊✂️AGSoft Audio Split
  • audio
  • audio_path
  • audio
  • duration_seconds
  • duration_timecode
  • file_size_mb
  • sample_rate
  • channels
output_nameaudio_split.mp3
output_path
audio_path
start_time0.0
end_time0.0
cut_modefast
formatsource
bitrate192k

🔊✂️AGSoft Audio Split is the node you reach for when you've got a TTS clip that starts with two seconds of silence, or a generated voiceover with a ruined first word, and you just want the good part. It cuts a fragment out of an audio file by start_time / end_time - and, unlike a lot of "audio editor" nodes, it can do it without re-encoding when you want speed and losslessness.

The core choice is the cut_mode:

  • fast - stream copy. FFmpeg copies the audio packets without decoding and re-encoding them. It's near-instant and bit-perfect, but the cut lands on a codec-frame boundary, so the exact in/out points may shift by a few milliseconds.
  • precise - re-encode. The cut is sample-accurate. Costs time and a tiny generation loss, but the timestamps are real.

format defaults to source, which keeps whatever the input was (with fast this means no re-encode at all). Pick mp3, wav, flac, ogg, or m4a to convert instead - conversion always re-encodes, and bitrate (96k–320k) only applies to the lossy ones. output_name sets the filename (the extension is derived from the effective format), output_path is the folder, empty = ComfyUI/output.

The gotcha that will bite you

The source audio can arrive two ways: through the audio_path string (a file on disk) or through the audio AUDIO socket (from another node). These are not the same thing. If audio comes in through the socket, it has already been decoded to PCM - so "keep the source format" produces a WAV, not your original MP3. True stream copy is only possible when the file is connected directly via audio_path.

So the rule is: for a lossless, instant cut of a file, feed it the path. If you've already got audio objects in a graph (say, after Load Audio), either accept that you're getting a WAV, or explicitly choose the format you want.

Outputs

This node is generous with what it returns:

  • audio_path (STRING) - where the result landed on disk.
  • audio (AUDIO) - the fragment as an audio object, so you can keep chaining without touching the filesystem.
  • duration_seconds, duration_timecode, file_size_mb - handy numbers for downstream logic or a display node.
  • sample_rate, channels - the technicals, if a downstream node needs to know what it's getting.

Install and notes

It's part of the comfyui-AGSoft pack. ComfyUI Manager → search "comfyui-AGSoft" → Install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Art-xmaster/comfyui-AGSoft

Restart ComfyUI and you're done. No model downloads, no extra Python deps for this node - it shells out to the FFmpeg that ComfyUI bundles (or a system ffmpeg on your PATH).

If you find yourself cutting and then wanting fades, normalization, reverse, or looping on the same fragment, that's the "Plus" sibling (AGSoft Audio Split Plus) - this one is the clean, fast, no-frills cutter.

CategoryAGSoft/Audio

Inputs (9)

NameTypeDefaultDescription
output_nameSTRINGaudio_split.mp3Output filename. The extension is set by the effective output format. --- Имя итогового файла. Расширение задаётся итоговым форматом.
output_pathSTRINGOutput directory. If empty, ComfyUI/output is used. --- Папка сохранения. Если пусто, используется ComfyUI/output.
audio_pathSTRINGPath to the source audio file. Used only if audio input is not connected. TIP: for a true lossless stream copy (fast mode, format=source), connect the file here via audio_path rather than the AUDIO socket - the socket always delivers already-decoded PCM (WAV). --- Путь к исходному аудиофайлу. Используется, только если вход audio не подключен. СОВЕТ: для настоящего stream copy без потерь (режим fast, format=source) подключайте файл сюда через audio_path, а не через сокет AUDIO - сокет всегда передаёт уже декодированный PCM (WAV).
start_timeFLOAT0.00–86400Fragment start (seconds). 0 = from the beginning. --- Начало фрагмента (в секундах). 0 = с начала.
end_timeFLOAT0.00–86400Fragment end (seconds). 0 = to the end of the audio. --- Конец фрагмента (в секундах). 0 = до конца аудио.
cut_modeCOMBOfastfast = stream copy (no re-encode, quick, cut at codec-frame boundary). precise = re-encode (sample-accurate cut). --- fast = stream copy (без перекодировки, быстро, рез по границе кадра кодека). precise = перекодирование (точность до сэмпла).
formatCOMBOsourceOutput format. source = keep the source format (no re-encode in fast mode). mp3/wav/flac/ogg/m4a = convert to that format. NOTE: if the source is connected via the AUDIO socket (not audio_path), the audio is already decoded to PCM, so the 'source' format is WAV. To get MP3 etc., choose it explicitly (re-encode) or connect the file via audio_path for a true stream copy. --- Формат выхода. source = сохранить формат источника (без перекодировки в режиме fast). mp3/wav/flac/ogg/m4a = конвертировать в этот формат. ВАЖНО: если источник подключён через сокет AUDIO (а не audio_path), аудио уже декодировано в PCM, поэтому форматом 'source' будет WAV. Чтобы получить MP3 и т.д., выберите его явно (перекодирование) либо подключите файл через audio_path для настоящего stream copy.
bitrateCOMBO192kBitrate for lossy formats (mp3/ogg/m4a). Ignored for wav/flac. --- Битрейт для lossy-форматов (mp3/ogg/m4a). Игнорируется для wav/flac.
audiooptAUDIOOptional source audio from ComfyUI. Has priority over audio_path. NOTE: audio via this socket is already decoded to PCM (WAV), so format=source will produce WAV. For a true lossless stream copy use audio_path instead. --- Опциональный исходный звук из ComfyUI. Имеет приоритет над audio_path. ВАЖНО: аудио через этот сокет уже декодировано в PCM (WAV), поэтому format=source даст WAV. Для настоящего stream copy без потерь используйте audio_path.

Outputs (7)

NameTypeDescription
audio_pathSTRING
audioAUDIO
duration_secondsFLOAT
duration_timecodeSTRING
file_size_mbFLOAT
sample_rateINT
channelsINT