Overview
The 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 audio segments in a chosen format. This is useful for processing large audio files by breaking them down into smaller parts for easier handling, analysis, or uploading.
Common scenarios include:
- Splitting long podcast recordings into smaller episodes.
- Breaking down large audio files for transcription in manageable pieces.
- Preparing audio segments for streaming or distribution.
For example, you can input a large MP3 file and split it into 10 MB chunks, outputting each segment as an MP3 or converting to another format like WAV.
Properties
Name | Meaning |
---|---|
Input Type | Choose whether to use "Binary Data" (audio from a binary property) or "File Path" (path from previous node) as input. |
Binary Property | Name of the binary property containing the audio file to split (used if Input Type is Binary Data). |
File Path Field | Name of the JSON property containing the file path (used if Input Type is File Path). |
Chunk Size | Size of each chunk in megabytes (MB). |
Output Prefix | Prefix string used for naming the output chunk files. |
Output Format | Format for output chunks: "Same As Input", "MP3", "M4A", or "WAV". |
Delete Original File After Processing | Whether to delete the original file after successful processing (only applicable when using File Path input). |
Memory Management | How to handle memory usage during processing: "Standard" (default) or "Low Memory" (uses less RAM but slower). |
Output
The node outputs an array of items, each representing one audio chunk with the following structure:
json
:filename
: The name of the chunk file.size
: Size of the chunk in bytes.sizeInMB
: Size of the chunk in megabytes.originalFile
: The original input filename with extension.duration
: Duration of the chunk in seconds (approximate based on chunk size).
binary
:data
: The binary content of the audio chunk, prepared for further n8n processing.
If memory management is set to "Low Memory," the binary data is streamed and buffered minimally to reduce RAM usage.
Dependencies
- FFmpeg: This node requires FFmpeg installed and accessible in the system's PATH. FFmpeg is used to probe and split the audio files.
- Node.js modules:
fluent-ffmpeg
,fs
,path
,os
, andchild_process
are used internally. - No special credentials or API keys are required.
Troubleshooting
- FFmpeg not found error: If the node throws an error stating FFmpeg is missing, ensure FFmpeg is installed on your machine and available in the system PATH.
- No binary data property exists: When using binary input, verify that the specified binary property name matches the actual binary data property in the input item.
- File path not found or inaccessible: When using file path input, confirm the file exists at the given path and is readable by the n8n process.
- Invalid input type: Ensure the "Input Type" parameter is correctly set to either "Binary Data" or "File Path".
- Insufficient permissions: The node writes temporary files to the OS temp directory; lack of write permissions may cause failures.
- Original file deletion issues: If enabled, the node attempts to delete the original file after processing. Failure to delete will be logged as a warning but won't stop execution.