Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:18
What would you like to do? - Converts .wav files to 16bits/44khz (CD quality)
# - 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
# 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
# Do it!
if [ -f "$1" ]; then
convertwav "$1"
elif [ -d "$1" ]; then
cd "$1"
for wavfile in *.wav; do
convertwav "$wavfile"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment