File: mt-daapd-ssc.sh

package info (click to toggle)
mt-daapd 0.9~r1696.dfsg-16
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 4,000 kB
  • ctags: 3,220
  • sloc: ansic: 25,552; sh: 9,496; perl: 454; xml: 339; makefile: 225
file content (42 lines) | stat: -rwxr-xr-x 659 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
#
# script to facilitate server-side transcoding of ogg files
#
#
# Usage: mt-daapd-ssc.sh <filename> <offset> <length in seconds>
#
# You may need to fix these paths:
#

WAVSTREAMER=wavstreamer
OGGDEC=oggdec
FLAC=flac

ogg_file() {
    $OGGDEC --quiet -o - "$FILE" | $WAVSTREAMER -o $OFFSET $FORGELEN
}


flac_file() {
    $FLAC --silent --decode --stdout "$FILE" | $WAVSTREAMER -o $OFFSET $FORGELEN
}

FILE=$1
OFFSET=${2:-0}

if [ "$3" != "" ]; then
    FORGELEN="-l $3"
fi

case "$1" in
  *.[oO][gG][gG])
  ogg_file
  ;;
  *.[fF][lL][aA][cC])
  flac_file
  ;;
  *)
# here you could cat a generic "error" wav...
# cat /path/to/error.wav
  ;;
esac