I have this script that I use to convert all the wav-files in the directory to 16 bit with 44100 hz. However, it also converts files that already have these properties. How can I filter the files so that only the ones that need conversion are converted?
I am working on Win 10 with ubuntu.
#!/bin/sh
for i in *.WAV;
do
name=`echo "$i" | cut -d'.' -f1`
echo "$name"
ffmpeg -i -f "$i" -acodec pcm_s16le -ar 44100 "${name}.wav";
done
Edit: Would it also be possible to have this loop over the files in subdirectories as well?