fix ssc script for files with spaces

This commit is contained in:
Ron Pedde 2005-03-05 05:44:35 +00:00
parent 54ff9e862e
commit daa469773b

View File

@ -13,16 +13,16 @@ OGGDEC=oggdec
FLAC=flac
ogg_file() {
$OGGDEC --quiet -o - "$1" | $WAVSTREAMER -o $2 -l $3
$OGGDEC --quiet -o - "$FILE" | $WAVSTREAMER -o $OFFSET $FORGELEN
}
flac_file() {
$FLAC --silent --decode --stdout "$1" | $WAVSTREAMER -o $2 -l $3
$FLAC --silent --decode --stdout "$FILE" | $WAVSTREAMER -o $OFFSET $FORGELEN
}
FILE=$1
OFFSET=0
FORGELEN=0
if [ "$2" == "" ]; then
OFFSET=0
@ -31,19 +31,17 @@ else
fi
if [ "$3" == "" ]; then
FORGELEN=0
else
FORGELEN=$3
if [ "$3" != "" ]; then
FORGELEN="-l $3"
fi
if ( echo $1 | grep -i "\.ogg$" > /dev/null 2>&1 ); then
ogg_file $1 $OFFSET $FORGELEN
ogg_file
exit;
fi
if ( echo $1 | grep -i "\.flac$" > /dev/null 2>&1 ); then
flac_file $1 $OFFSET $FORGELEN
flac_file
exit;
fi