Split Audio icon

Split Audio

Splits an audio file into chunks of specified size

Overview

The Split Audio node splits an audio file into multiple chunks of a specified size. It supports input either as binary data or as a file path, and outputs the resulting audio segments either as binary data in memory or as file paths on disk.

This node is useful when you need to process or analyze large audio files in smaller parts, for example:

  • Splitting long podcast recordings into manageable segments.
  • Preparing audio files for streaming or upload with size limits.
  • Breaking down audio for transcription or speech recognition in chunks.

Practical example: You have a 100 MB audio recording and want to split it into 10 MB segments named "segment_001.mp3", "segment_002.mp3", etc., optionally converting the output format to MP3 and storing the chunks on disk to avoid high RAM usage.


Properties

Name Meaning
Input Type Choose whether the input audio comes from Binary Data (an incoming binary property) or a File Path (a path string from previous nodes like Google Drive or Read/Write Files).
Binary Property (If Input Type is Binary Data) The name of the binary property containing the audio file to split.
File Path Field (If Input Type is File Path) The JSON property name that contains the file path string (e.g., fileName).
Chunk Size Size of each chunk in megabytes (MB). The node splits the audio into segments approximately this size.
Output Prefix Prefix used for naming the output chunk files (e.g., "segment" results in filenames like "original_segment_001.mp3").
Output Format Format for the output chunks. Options are: Same As Input, MP3, M4A, or WAV.
Delete Original File After Processing (Only if Input Type is File Path) Whether to delete the original input file after successful splitting.
Memory Management How to handle memory usage during processing: Standard (default) or Low Memory (uses less RAM but slower).
Output Storage Where to store the output chunks: Memory (Binary Data) stores chunks in memory as binary data (default n8n behavior), Disk (File Paths) keeps chunks on disk and returns their file paths to prevent RAM issues.
Output Directory (If Output Storage is Disk) Directory path where split files will be saved. If empty, the system temporary directory is used.

Output

The node outputs an array of items, each representing one audio chunk. Each item contains:

  • json: Metadata about the chunk including:

    • filename: The chunk's filename.
    • filePath (if stored on disk): Full path to the chunk file.
    • size: Size in bytes.
    • sizeInMB: Size in megabytes.
    • originalFile: Original input filename with extension.
    • duration: Duration of the chunk in seconds (approximate).
    • storageMode: "disk" if stored on disk; omitted if stored in memory.
  • binary (if output storage is memory): Contains the chunk's audio data under the property data (or configured binary property), ready for further processing in n8n.

If output storage is set to disk, the node only returns file paths and metadata without loading the chunk data into memory.


Dependencies

  • FFmpeg: This node requires FFmpeg installed and accessible in the system PATH. FFmpeg is used to perform the actual audio splitting.
  • Node.js modules used internally include fluent-ffmpeg, fs, path, and os.
  • No special credentials are required unless accessing files from external services before this node.

Troubleshooting

  • FFmpeg Not Found:
    Error: "FFmpeg is required for this node to work but was not found. Please install FFmpeg."
    Solution: Install FFmpeg on your system and ensure it is available in the command line PATH.

  • Missing Binary Data Property:
    Error: "No binary data property "" exists on item!"
    Solution: Verify the binary property name matches the input data and that the previous node provides binary data.

  • File Path Not Found or Unreadable:
    Error: "Cannot access file at path: . Please make sure the file exists and is readable."
    Solution: Check the file path is correct and the file permissions allow reading.

  • No Usable Binary Data:
    Error: "No usable binary data found! The data must either be stored in a file or as base64 data."
    Solution: Ensure the binary data includes either a file path or base64 encoded data.

  • Invalid Input Type:
    Error: "Invalid input type. Please select either Binary Data or File Path."
    Solution: Select a valid input type in the node parameters.

  • Cleanup Failures:
    Warnings may appear if temporary files or directories cannot be deleted. These usually do not affect processing but indicate permission or locking issues.


Links and References

Discussion