Audio · Merge Tracks

Mixes two audio binaries (delay & gain on track 2) and returns the result as a binary

Overview

This node merges two audio files provided as binary data, allowing the user to apply a delay and gain adjustment to the second audio track before mixing. It outputs the combined audio in a specified format. This is useful for audio processing workflows where combining multiple audio sources with timing and volume adjustments is needed, such as podcast editing, music production, or sound design.

Use Case Examples

  1. Mix two audio recordings where the second track is delayed by 500ms and its volume increased by 3dB, outputting the result as an MP3 file.
  2. Combine two sound effects with no delay or gain change, outputting the merged audio in the same format as the first input file.

Properties

Name Meaning
File 1 – Binary Property The name of the binary property containing the first audio file to merge.
File 2 – Binary Property The name of the binary property containing the second audio file to merge.
Delay for File 2 (ms) The delay in milliseconds to apply to the second audio file before mixing.
Gain for File 2 (dB) The gain adjustment in decibels to apply to the second audio file before mixing.
Output Format The audio format for the output file. Can be the same as the first file or explicitly set to WAV, MP3, or FLAC.
Output Binary Property Name The name of the binary property where the merged audio file will be stored in the output.

Output

JSON

  • json - Empty JSON object as the node outputs only binary data.
    binary - The merged audio file binary data stored under the user-defined binary property name.

Dependencies

  • fluent-ffmpeg library for audio processing
  • Helper functions for binary data handling and ffmpeg execution

Troubleshooting

  • Ensure the specified binary properties for the input audio files exist and contain valid audio data, otherwise the node will throw an error.
  • If the output format is set explicitly, make sure the required codecs (libmp3lame for MP3, pcm_s16le for WAV, flac for FLAC) are supported by the ffmpeg installation.
  • Large audio files may increase processing time; consider optimizing input sizes if performance is an issue.

Discussion