Last active
August 29, 2015 14:18
-
-
Save fzero/bf393828943455304949 to your computer and use it in GitHub Desktop.
wav1644.sh - Converts .wav files to 16bits/44khz (CD quality)
This file contains hidden or 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 | |
# wav1644.sh - Converts .wav files to 16bits/44khz (CD quality) | |
# Many iPad audio apps need this, and it's a good size/quality ratio for | |
# uncompressed audio anyway. Fuck Neil Young and other clueless audiophiles. | |
# Download this to somewhere in your $PATH and make it exectutable with | |
# chmod a+x wav1644.sh | |
# WAV conversion function - uses ffmpeg | |
function convertwav { | |
mv "$1" "$1.original" | |
ffmpeg -i "$1.original" -acodec pcm_s16le -ar 44100 "$1" | |
} | |
# Usage | |
if [ "$1" == "" ]; then | |
echo "Usage: $(basename $0) <high sampling rate wav or folder>" | |
exit 1 | |
fi | |
# Do it! | |
if [ -f "$1" ]; then | |
convertwav "$1" | |
elif [ -d "$1" ]; then | |
cd "$1" | |
for wavfile in *.wav; do | |
convertwav "$wavfile" | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment