Page 1 of 1

batch convert wavs

Posted: Wed Jan 13, 2016 2:25 pm
by skei
is there a simple way to convert all wav files in a directory to 44.1 khz, 16 bit, mono?
(overwriting the original file)
i did some experimenting with sox, but i'm just getting errors..
my sox-fu is not good.. :-/
- tor-helge

Re: batch convert wavs

Posted: Wed Jan 13, 2016 2:59 pm
by asbak
You could do it using ffmpeg. No guarantees, use example at own risk.

Code: Select all

mkdir converted
for i in *.wav; do ffmpeg -i "$i" -acodec pcm_s16le -ar 44100 -ac 1 -f wav converted/"${i%.wav}.wav"; done
mv converted/*.wav .
Just be very aware that this will overwrite the original wav files, as you asked for. So be careful about using the last line.

Re: batch convert wavs

Posted: Wed Jan 13, 2016 3:01 pm
by skei
thanks a lot!
will try it out in a little while..
- th

edit: it worked really well.. my live/performance project shrank from 1.1gb to 490mb, and bitwig handled the changed files without problems (re-analyzed the files when i opened the projet)..
thanks again!
- tor-helge

Re: batch convert wavs

Posted: Wed Jan 13, 2016 3:31 pm
by asbak
yw :)