annotate gettracks.sh @ 11:c122160e07da

Use Tcl 8.2
author darius
date Thu, 18 Jul 2002 06:38:42 +0000
parents c9ade2a9c808
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
74031379d3cb Initial revision
darius
parents:
diff changeset
1 #!/bin/sh
74031379d3cb Initial revision
darius
parents:
diff changeset
2
74031379d3cb Initial revision
darius
parents:
diff changeset
3 cddev=/dev/acd0c
74031379d3cb Initial revision
darius
parents:
diff changeset
4 root=`dirname $0`
74031379d3cb Initial revision
darius
parents:
diff changeset
5 if [ $# -eq 0 ]; then
74031379d3cb Initial revision
darius
parents:
diff changeset
6 tracks=`$root/cddb-id -f $cddev -n`
74031379d3cb Initial revision
darius
parents:
diff changeset
7 else
74031379d3cb Initial revision
darius
parents:
diff changeset
8 tracks=$*
74031379d3cb Initial revision
darius
parents:
diff changeset
9 fi
74031379d3cb Initial revision
darius
parents:
diff changeset
10
74031379d3cb Initial revision
darius
parents:
diff changeset
11 echo Ripping tracks $tracks
74031379d3cb Initial revision
darius
parents:
diff changeset
12
10
c9ade2a9c808 Use dd and lame to rip and compress.
darius
parents: 5
diff changeset
13 #ripper="cdd -t \$num - | sox -x -t wav - -t wav -"
c9ade2a9c808 Use dd and lame to rip and compress.
darius
parents: 5
diff changeset
14 #ripper="cdda2wav -O wav -t \$num -D 0,6,0 -"
c9ade2a9c808 Use dd and lame to rip and compress.
darius
parents: 5
diff changeset
15 #comp="lame -V 1 -m j -b 160 - -"
3
74031379d3cb Initial revision
darius
parents:
diff changeset
16 #comp="gogo -silent -offset 0 -b 192 stdin"
74031379d3cb Initial revision
darius
parents:
diff changeset
17
74031379d3cb Initial revision
darius
parents:
diff changeset
18 for t in $tracks ; do
74031379d3cb Initial revision
darius
parents:
diff changeset
19 num=`printf %02d $t`
74031379d3cb Initial revision
darius
parents:
diff changeset
20 name=`printf track_%s.mp3 $num`
5
cf06ab549064 Write files to mark our progress and skip doing tracks if we have
darius
parents: 3
diff changeset
21 if [ -e ".${num}.done" ]; then
cf06ab549064 Write files to mark our progress and skip doing tracks if we have
darius
parents: 3
diff changeset
22 echo Skipping $num
cf06ab549064 Write files to mark our progress and skip doing tracks if we have
darius
parents: 3
diff changeset
23 continue
cf06ab549064 Write files to mark our progress and skip doing tracks if we have
darius
parents: 3
diff changeset
24 fi
3
74031379d3cb Initial revision
darius
parents:
diff changeset
25 echo Ripping $num to $name
10
c9ade2a9c808 Use dd and lame to rip and compress.
darius
parents: 5
diff changeset
26 # eval $ripper 2>> rip.log | $comp > $name
c9ade2a9c808 Use dd and lame to rip and compress.
darius
parents: 5
diff changeset
27 dd if=/dev/acd0t$t bs=2352 | lame -r -x -V 1 -b 128 -h -m j -q1 - - >$name
3
74031379d3cb Initial revision
darius
parents:
diff changeset
28 if [ $? -ne 0 ]; then
74031379d3cb Initial revision
darius
parents:
diff changeset
29 echo "Failed!"
74031379d3cb Initial revision
darius
parents:
diff changeset
30 exit 1
74031379d3cb Initial revision
darius
parents:
diff changeset
31 fi
5
cf06ab549064 Write files to mark our progress and skip doing tracks if we have
darius
parents: 3
diff changeset
32 touch ".${num}.done"
3
74031379d3cb Initial revision
darius
parents:
diff changeset
33 done
74031379d3cb Initial revision
darius
parents:
diff changeset
34
5
cf06ab549064 Write files to mark our progress and skip doing tracks if we have
darius
parents: 3
diff changeset
35 rm .*.done
cf06ab549064 Write files to mark our progress and skip doing tracks if we have
darius
parents: 3
diff changeset
36