2011-09-01 00:30:45 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2011-12-25 01:03:42 +00:00
|
|
|
SRC="$1"
|
2011-09-01 00:30:45 +00:00
|
|
|
DEST="$2"
|
|
|
|
|
2011-12-25 01:03:42 +00:00
|
|
|
|
|
|
|
TYPE=`file -b "$SRC"`
|
2011-09-01 00:30:45 +00:00
|
|
|
RES=`echo "$TYPE" | grep "WAVE audio"`
|
|
|
|
if [ ! "$?" == "0" ]
|
|
|
|
then
|
2011-12-31 00:05:14 +00:00
|
|
|
echo "File $SRC is not a wav file..."
|
2011-12-25 01:03:42 +00:00
|
|
|
echo "Type is $TYPE"
|
|
|
|
exit 0
|
2011-09-01 00:30:45 +00:00
|
|
|
fi
|
|
|
|
|
2011-12-25 01:03:42 +00:00
|
|
|
BASENAME=`basename "$SRC"`
|
|
|
|
MP3FILE="`echo ${BASENAME%wav}mp3`"
|
|
|
|
lame --quiet --preset insane "$SRC" "$DEST/$MP3FILE"
|
2011-09-01 00:30:45 +00:00
|
|
|
exit "$?"
|