Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- die() { echo >&2 "$@"; exit 1; }
- [ $# -eq 3 ] || die "Syntax: $0 <input file> <output file> <vbr quality factor>"
- [ -e "$1" ] || die "Input file does not exist: $1"
- IN=`readlink -e $1`
- OUT=$2
- QFACTOR=$3
- [ "$IN" = "$OUT" ] && die "Input file cannot be the same as the output file!"
- COMMENTS="${IN}.comments"
- PCM="${IN}.wav"
- vorbiscomment -l $IN > $COMMENTS
- ( oggdec -o $PCM $IN && oggenc -q $QFACTOR -o $OUT $PCM ) || die "Recoding failed!"
- vorbiscomment -w $OUT -c $COMMENTS || die "Could not restore comments!"
- rm $PCM $COMMENTS
Advertisement
Add Comment
Please, Sign In to add comment