Split Audio icon

Split Audio

Splits an audio file into various chunks and returns the filenames of those chunks

Overview

This node splits a given audio file into multiple smaller chunks based on specified chunk length and overlap duration. It processes the input audio file, dividing it into segments of fixed length with optional overlapping between consecutive chunks. The output is a list of filenames corresponding to each generated audio chunk.

This node is useful in scenarios such as:

  • Preparing audio files for transcription or analysis by breaking them into manageable parts.
  • Creating previews or samples from longer audio recordings.
  • Processing large audio files in parallel workflows by splitting them first.

For example, if you have a 60-second audio recording and want to split it into 10-second chunks with 2 seconds overlap, this node will generate multiple 10-second audio files where each chunk overlaps the previous one by 2 seconds.

Properties

Name Meaning
Chunk Length (Seconds) Duration in seconds of each audio chunk to be created.
Overlap Length (Seconds) Duration in seconds that each chunk overlaps with the previous chunk.
Input File Path Full path to the source audio file to be split.
Output File Path Template Template for naming output chunk files. Use %i as a placeholder for the chunk index number.

Output

The node outputs a JSON array where each item contains a field chunkFiles, which is an array of strings. Each string is the filename of a generated audio chunk.

Example output structure:

[
  {
    "chunkFiles": [
      "split_chunk_0.mp3",
      "split_chunk_1.mp3",
      "split_chunk_2.mp3"
    ]
  }
]

No binary data is output directly; only references to the generated chunk files are provided.

Dependencies

  • This node depends on the fluent-ffmpeg library to handle audio processing and splitting.
  • The system running the node must have FFmpeg installed and accessible in the environment, as fluent-ffmpeg is a wrapper around the FFmpeg command-line tool.
  • No external API keys or online services are required.

Troubleshooting

  • Error: Could not find duration
    This error occurs if the node cannot determine the length of the input audio file. Ensure the input file path is correct and points to a valid audio file.

  • FFmpeg-related errors
    If the node fails during chunk creation, verify that FFmpeg is properly installed and available in the system PATH. Also, check that the input file format is supported by FFmpeg.

  • Output file naming issues
    If the output template does not include %i, the node appends the chunk index automatically. However, using %i in the template is recommended to avoid overwriting files.

  • Overlap greater than chunk length
    Setting the overlap length equal to or greater than the chunk length may cause unexpected behavior or infinite loops. Always ensure overlap is less than chunk length.

Links and References

Discussion