| 1 |
#!/bin/sh |
| 2 |
# |
| 3 |
# auenc -- version 0.1 |
| 4 |
# |
| 5 |
# A wrapper for lame to encode multiple files. By default, a .wav |
| 6 |
# extension is removed and replaced by .mp3 . |
| 7 |
# |
| 8 |
# (C) 1999 Gerhard Wesp <[email protected]> under the GPL. |
| 9 |
|
| 10 |
# set the variables below according to your taste |
| 11 |
LAME=lame |
| 12 |
LAME_OPTS="-S -h -v -V 0 -b 256" # high quality, silent operation |
| 13 |
|
| 14 |
if [ $# -lt 1 ] ; then |
| 15 |
exec 1>&2 |
| 16 |
cat << _EOF_ |
| 17 |
usage: $0 [options] file... |
| 18 |
options: |
| 19 |
-d --delete: delete original file after successful encoding |
| 20 |
_EOF_ |
| 21 |
exit 1 |
| 22 |
fi |
| 23 |
|
| 24 |
unset DELETE |
| 25 |
case "$1" in |
| 26 |
-d | --delete ) DELETE=1 ; shift ;; |
| 27 |
esac |
| 28 |
|
| 29 |
for f |
| 30 |
do |
| 31 |
$LAME $LAME_OPTS "$f" `basename "$f" .wav`.mp3 || { |
| 32 |
exec 1>&2 |
| 33 |
echo "encoding of $f failed, aborting..." |
| 34 |
exit 1 |
| 35 |
} |
| 36 |
if [ -n "$DELETE" ] ; then |
| 37 |
rm -f "$f" |
| 38 |
fi |
| 39 |
done |