ppss/wav2mp3.sh

20 lines
350 B
Bash
Raw Normal View History

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