Skip to content

Instantly share code, notes, and snippets.

@jojomi
Created January 21, 2016 20:54
Show Gist options
  • Save jojomi/c70bcf4ba735ef3d9c60 to your computer and use it in GitHub Desktop.
Save jojomi/c70bcf4ba735ef3d9c60 to your computer and use it in GitHub Desktop.
Convert a directory of wav files to opus
#!/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