-1

Ok, hello. I have some scripts that I use on the command line to rip mp3s from .wav and .aif files. Lately I've been playing with this sampler that wants only mono wav files. WAIT - I promise this is a programming question. I want to run a command to split all wav files inside a directory to mono files with a different file name. So, for example Drummerrolleasy.wav, would then have DrummerrolleasyL.wav in the same directory as the left mono split of the original stereo wav. I will ensure that when the command runs, there are only stereo wav files in the directory. I have this command:

find . -name "*.wav" -execdir echo $1    {} \;

that works as expected, and provides me the names of the files, one by one, that I would like to then put inside a call to sox. a sample run of the name list - yes I already added the L split files so really this shows what directory should look like AFTER execution this:

find . -type f -name “*.wav” -exec sox {} "$1" L"$1"  \;

does not work (runs but does nothing), and I'm not finding anything particularly illuminating for how to do this. I might need to spawn a new shell, but this doesn't work either because the shell just sits there:

find . -name "*.wav" -execdir sh -c 'sox "{}" "$1" “L””$1"’ \;

If I have to figure this out on my own, that can work too, and when I get there I will update but if someone would like to point me in the right direction I would be much obliged.

  • also, the direct call to sox looks like this: **sox Drummersurvive.wav DrummersurviveL.wav remix 1** - source name, copy name, remix and 1 for the LEFT channel. – kristeraxel Jun 26 '17 at 04:19
  • nor does this work: **find . -type f -name “*.wav” -execdir sox {} "$1" L"$1" remix 1 \;** – kristeraxel Jun 26 '17 at 04:24

1 Answers1

0

Goes like this:

for file in *.wav; do sox $file L$file remix 1; done

thanks Mix .L and .R files into a stereo file using SOX in bulk

saves me a lot of time. BASH rules.