ppss/wav2mp3.sh

20 lines
349 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-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
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 "$?"