xref: /third_party/lame/misc/auenc (revision 159b3361)
1159b3361Sopenharmony_ci#!/bin/sh
2159b3361Sopenharmony_ci# 
3159b3361Sopenharmony_ci# auenc -- version 0.1
4159b3361Sopenharmony_ci#
5159b3361Sopenharmony_ci# A wrapper for lame to encode multiple files.  By default, a .wav
6159b3361Sopenharmony_ci# extension is removed and replaced by .mp3 .
7159b3361Sopenharmony_ci#
8159b3361Sopenharmony_ci# (C) 1999 Gerhard Wesp <gwesp@cosy.sbg.ac.at> under the GPL.
9159b3361Sopenharmony_ci
10159b3361Sopenharmony_ci# set the variables below according to your taste
11159b3361Sopenharmony_ciLAME=lame
12159b3361Sopenharmony_ciLAME_OPTS="-S -h -v -V 0 -b 256" # high quality, silent operation
13159b3361Sopenharmony_ci
14159b3361Sopenharmony_ciif [ $# -lt 1 ] ; then
15159b3361Sopenharmony_ci  exec 1>&2
16159b3361Sopenharmony_ci  cat << _EOF_
17159b3361Sopenharmony_ciusage: $0 [options] file...
18159b3361Sopenharmony_cioptions:
19159b3361Sopenharmony_ci  -d --delete: delete original file after successful encoding
20159b3361Sopenharmony_ci_EOF_
21159b3361Sopenharmony_ci  exit 1
22159b3361Sopenharmony_cifi
23159b3361Sopenharmony_ci
24159b3361Sopenharmony_ciunset DELETE
25159b3361Sopenharmony_cicase "$1" in
26159b3361Sopenharmony_ci  -d | --delete ) DELETE=1 ; shift ;;
27159b3361Sopenharmony_ciesac
28159b3361Sopenharmony_ci
29159b3361Sopenharmony_cifor f
30159b3361Sopenharmony_cido
31159b3361Sopenharmony_ci  $LAME $LAME_OPTS "$f" `basename "$f" .wav`.mp3 || {
32159b3361Sopenharmony_ci    exec 1>&2
33159b3361Sopenharmony_ci    echo "encoding of $f failed, aborting..."
34159b3361Sopenharmony_ci    exit 1
35159b3361Sopenharmony_ci  }
36159b3361Sopenharmony_ci  if [ -n "$DELETE" ] ; then
37159b3361Sopenharmony_ci    rm -f "$f"
38159b3361Sopenharmony_ci  fi
39159b3361Sopenharmony_cidone
40