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