Page 1 of 1

Converting ape to ogg files

Posted: 5. Feb 2010, 17:56
by thenktor
Because I've been annoyed of converting all the ape files to ogg by hand (mac does not support * in command line), I've written a small script to do it for me:

Code: Select all

#!/bin/sh
# converts ape to ogg vorbis files

case "$1" in
	"-h")
	echo "usage: $0 file1.ape file2.ape [...]"
	exit 0
	;;
	"--help")
	echo "usage: $0 file1.ape file2.ape [...]"
	exit 0
	;;
esac

for n in "$@"; do
	n2=`echo "$n" | sed s/\.ape$//`
	mac "$n" "$n2.wav" -d
	oggenc -q7 "$n2.wav"
	rm "$n2.wav"
done
Of course you can change to mp3, flac, whatever...