3 #=======================================================================
5 # File ID: ffabc804-0665-11e3-a941-a088b4ddef28
6 # Convert .wav files to .mp3
9 # Author: Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 2 or later.
11 #=======================================================================
25 " -n "$progname" -- "$@
")"
26 test "$?" = "0" ||
exit 1
34 -h|
--help) opt_help
=1; shift ;;
35 -q|
--quiet) opt_quiet
=$
(($opt_quiet + 1)); shift ;;
36 -v|
--verbose) opt_verbose
=$
(($opt_verbose + 1)); shift ;;
37 --version) echo $progname $VERSION; exit 0 ;;
39 *) echo $progname: Internal error
>&2; exit 1 ;;
42 opt_verbose
=$
(($opt_verbose - $opt_quiet))
44 if test "$opt_help" = "1" -o -z "$1"; then
45 test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
48 Usage: $progname [options] wav_file [...]
55 Be more quiet. Can be repeated to increase silence.
57 Increase level of verbosity. Can be repeated.
59 Print version information.
69 tmpuuid
=$
(suuid
-m -t c_wav_to_mp3
-wa -c "Starting conversion")
70 test -z "$tmpuuid" && { echo "$progname: Broken suuid(1)" >&2; exit 1; }
73 echo ======== $
(ls -l --si "$curr")
74 noext
=$
(basename "$curr" .wav
)
77 test -e "$mp3file" && { echo $mp3file: File already exists
>&2; continue; }
78 wavid
=$
(finduuid
"$wavfile")
80 test -n "$wavid" && wavid_str
=" (File ID $wavid)"
81 lame
-h --tc $
(suuid
-m -t encode
,c_wav_to_mp3
-wa -c "Converting $wavfile$wavid_str to mp3") "$wavfile" "$mp3file"