Created
January 21, 2016 20:54
-
-
Save jojomi/c70bcf4ba735ef3d9c60 to your computer and use it in GitHub Desktop.
Convert a directory of wav files to 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
#!/usr/bin/env bash | |
shopt -s globstar | |
for file in ./**/*.wav | |
do | |
echo "$file" | |
outfile="${file%.wav}.opus" | |
echo "$outfile" | |
if [ -f "$outfile" ] | |
then | |
echo "> Skipped." | |
else | |
opusenc "$file" "$outfile" > /dev/null | |
if [ -f "$outfile" ] | |
then | |
rm "$file" | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment