Skip to content

Instantly share code, notes, and snippets.

@ecsplendid
Created March 14, 2024 23:29
Show Gist options
  • Save ecsplendid/5812c9ff6f0d32b65c092e01a07b597a to your computer and use it in GitHub Desktop.
Save ecsplendid/5812c9ff6f0d32b65c092e01a07b597a to your computer and use it in GitHub Desktop.
cd "$1"
current_dir=$(pwd)
filelist="$current_dir/filelist.txt"
output_file="$current_dir/CombinedAudio.w64"
log_file="$current_dir/ffmpeg_log.txt"
rm -f "$filelist"
rm -f "$log_file"
find "$current_dir" -maxdepth 1 -name 'MixPre-*.WAV' -print0 | sort -z | xargs -0 -I {} echo "file '{}'" >> "$filelist"
echo "Concatenating files... See $log_file for details."
/opt/homebrew/bin/ffmpeg -nostdin -y -f concat -safe 0 -i "$filelist" -c copy -f w64 "$output_file" >"$log_file" 2>&1
echo "Done. Combined file created as $output_file."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment