Created
July 24, 2017 18:49
-
-
Save michaellindman/2a3a819a7c9b206802306d0b7e7d9a19 to your computer and use it in GitHub Desktop.
convert wav files to flac
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
#!/bin/bash | |
# loop through files in currently active directory | |
for f in *.wav | |
do | |
# converts wav files to flac using sox | |
sox "$f" "${f%.*}".flac | |
shopt -s nullglob | |
#check for flac files in current directory | |
if [[ -n $(echo *.flac) ]]; then | |
# check if flac directory exists | |
if [ ! -d "flac" ]; then | |
# creates flac direcotry if it doesn't already exist | |
mkdir flac | |
fi | |
# move all flac files to the flac directory | |
mv *.flac flac/ | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment