owntone-server/contrib/mt-daapd-ssc.sh

35 lines
576 B
Bash
Raw Normal View History

2005-02-23 23:59:53 -05:00
#!/opt/bin/bash
2005-02-21 13:41:12 -05:00
#
# script to facilitate server-side transcoding of ogg files
# Ron Pedde (ron@pedde.com)
#
# Usage: mt-daapd-ssc.sh <filename> <offset>
#
# This is not as flexible as Timo's transcoding script, but it works
# without perl, making it more suitable for the NSLU2.
#
ogg_file() {
2005-02-23 23:59:53 -05:00
if [ $OFFSET -eq 0 ]; then
oggdec --quiet -o - "$1"
else
oggdec --quiet -o - "$1" | dd bs=$OFFSET skip=1 2>/dev/null
fi
2005-02-21 13:41:12 -05:00
}
OFFSET=0
if [ "$2" == "" ]; then
OFFSET=0
else
OFFSET=$2
fi
2005-02-23 23:59:53 -05:00
if [ $OFFSET -lt 1024 ]; then
OFFSET=0
2005-02-21 13:41:12 -05:00
fi
2005-02-23 23:59:53 -05:00
ogg_file $1 $OFFSET