File: import

package info (click to toggle)
xwax 0.7-5
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 312 kB
  • ctags: 524
  • sloc: ansic: 3,921; makefile: 104; sh: 101
file content (45 lines) | stat: -rwxr-xr-x 981 bytes parent folder | download
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
43
44
45
#!/bin/sh
#
# This script takes a filename as an argument, and outputs signed,
# little-endian, 16-bit, 2 channel audio on standard output. Errors
# to standard error.
#
# You can adjust this script yourself to customise the support for
# different file formats and codecs.

FILE="$1"

case "$FILE" in

*.ogg)
    echo "Calling Ogg decoder..." >&2
    exec oggdec -Q --bits 16 --endianness 0 --sign 1 --raw --output - "$FILE"
    ;;

*.aac)
    echo "Calling AAC decoder..." >&2
    exec faad -b 1 -f 2 -w "$FILE"
    ;;

*.cdaudio)
    echo "Calling CD extract..." >&2
    exec cdparanoia -r `cat "$FILE"` -
    ;;

*.mp3)
    echo "Calling MP3 decoder..." >&2
    exec mpg123 -q -s "$FILE"
    ;;

*.flac)
    echo "Calling FLAC decoder..." >&2
    exec flac -d -c -s --force-raw-format --sign=signed --endian=little "$FILE"
    ;;

*)
    echo "Calling fallback decoder..." >&2
    exec ffmpeg -v 0 -i "$FILE" -f s16le -ar 44100 -
    #exec sox "$FILE" -t raw -s -
    ;;

esac