view gettracks.sh @ 5:cf06ab549064

Write files to mark our progress and skip doing tracks if we have already done them.
author darius
date Sat, 12 Aug 2000 07:11:06 +0000
parents 74031379d3cb
children c9ade2a9c808
line wrap: on
line source

#!/bin/sh

cddev=/dev/acd0c
root=`dirname $0`
if [ $# -eq 0 ]; then
  tracks=`$root/cddb-id -f $cddev -n`
else
  tracks=$*
fi

echo Ripping tracks $tracks

ripper="cdd -t \$num -"
comp="lame -x -b 192 - -"
#comp="gogo -silent -offset 0 -b 192 stdin"

for t in $tracks ; do
  num=`printf %02d $t`
  name=`printf track_%s.mp3 $num`
  if [ -e ".${num}.done" ]; then
    echo Skipping $num
    continue
  fi
  echo Ripping $num to $name
  eval $ripper 2>> rip.log | sox -t cdr - -t wav - | $comp > $name
  if [ $? -ne 0 ]; then
    echo "Failed!"
    exit 1
  fi
  touch ".${num}.done"
done

rm .*.done