Thursday, October 31, 2024

joining mp3s with different sample rates

Making this dancehall mix but first doing a conversion in a temporary directory before outputing the file


# Create a temporary directory
tmp_dir=$(mktemp -d)

# Convert the MP3 files to the temporary directory
for file in *.mp3; do
  sox "$file" -r 44100 "$tmp_dir/$file"
done

# Merge the converted files into a single output file in the current directory
sox "$tmp_dir"/*.mp3 dancehall.mp3

# Remove the temporary directory
rm -r "$tmp_dir"

No comments:

Post a Comment