Skip to content

Instantly share code, notes, and snippets.

@allen0125
Created December 23, 2021 08:56
Show Gist options
  • Save allen0125/d4c20ba1a9aaffd536d48b6ae1f02967 to your computer and use it in GitHub Desktop.
Save allen0125/d4c20ba1a9aaffd536d48b6ae1f02967 to your computer and use it in GitHub Desktop.
Audio to wav
filelist=$(find . -name '*.mp3' -o -name '*.mp4' -o -name '*.m4a')
OLDIFS="$IFS"
IFS=$"\n"
for filename in *.mp3 *.mp4 *.m4a
do
if [$filename == '.DS_Store' || $filename == ffmpeg_foo_to_wav.sh]
then
continue
fi
# ffmpeg -i $filename -acodec libmp3lame -ab 128k mp3/"${filename%.*}".mp3
ffmpeg -i $filename -acodec pcm_s16le -ar 44100 -ac 1 wav/"${filename%.*}".wav
done
IFS=$OLDIFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment