Follow

Today's zsh/sox combo: split a stereo file into two mono files.

#!/bin/zsh

infile=$1
infile_basename=${infile:r}
extension=${infile:e}

if [[ extension=~"[wav|aiff|snd]" && $(soxi -c $infile) -eq 2 ]]; then
sox $infile "$infile_basename"_left."$extension" remix 1
sox $infile "$infile_basename"_right."$extension" remix 2
else
echo "Not a stereo file!"
fi

Sign in to participate in the conversation
SoNoMu

SoNoMu (Sound Noise Music) is a mastodon instance for musicians, sound-artists, producers of any kind of aural noise, songwriters, bedroom producers, sonic manglers and algorave livecoders. -> more...