Created
April 7, 2019 21:41
-
-
Save benjaminoakes/89d050849b4938c422bfd739175ee1a5 to your computer and use it in GitHub Desktop.
Convert wav files in current directory to mp3, spx, vorbis, opus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# convert_wavs_to() { | |
# extension="$1" | |
# | |
# if [ ! -d "$extension" ]; then | |
# mkdir -p "$extension" | |
# | |
# for f in *.wav; do | |
# ffmpeg \ | |
# -i "$f" \ | |
# "$extension/$(basename "$f" .wav).$extension" | |
# done | |
# fi | |
# } | |
for f in *.wav; do | |
ffmpeg \ | |
-i "$f" \ | |
-b:a 20k \ | |
"$(basename "$f" .wav).mp3" | |
done | |
rm *.wav | |
# convert_wavs_to 'mp3' | |
# convert_wavs_to 'spx' | |
# convert_wavs_to 'ogg' | |
# convert_wavs_to 'opus' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment