hi all,

  i wrote a little shell script which wraps around lame in order to
encode multiple files in one batch.

  suggestions, bug reports and additional features are very welcome!

#!/bin/sh
# 
# auenc -- version 0.1
#
# A wrapper for lame to encode multiple files.  By default, a .wav
# extension is removed and replaced by .mp3 .
#
# (C) 1999 Gerhard Wesp <[EMAIL PROTECTED]> under the GPL.

# set the variables below according to your taste
LAME=/usr/bin/lame
LAME_OPTS="-S -h -v -V 0 -b 256" # high quality, silent operation

if [ $# -lt 1 ] ; then
  exec 1>&2
  cat << _EOF_
usage: $0 [options] file...
options:
  -d --delete: delete original file after successful encoding
_EOF_
  exit 1
fi

unset DELETE
case "$1" in ( -d | --delete )
  DELETE=1
  shift ;;
esac

for f in $* ; do
  if ! $LAME $LAME_OPTS "$f" `basename "$f" .wav`.mp3 ; then
    exec 1>&2
    echo "encoding of $f failed, aborting..."
    exit 1
  fi
  if [ -n "$DELETE" ] ; then
    rm -f "$f"
  fi
done

have fun,
-gerhard
-- 
| Gerhard Wesp                       http://www.cosy.sbg.ac.at/~gwesp
|
|    Q:      What do agnostic, insomniac dyslexics do at night?
|      A:      Stay awake and wonder if there's a dog.
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to