view gettracks.sh @ 10:c9ade2a9c808

Use dd and lame to rip and compress.
author darius
date Thu, 18 Jul 2002 06:37:59 +0000
parents cf06ab549064
children
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 - | sox -x -t wav - -t wav -"
#ripper="cdda2wav -O wav -t \$num -D 0,6,0 -"
#comp="lame -V 1 -m j -b 160 - -"
#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 | $comp > $name
  dd if=/dev/acd0t$t bs=2352 | lame -r -x -V 1 -b 128 -h -m j -q1 - - >$name
  if [ $? -ne 0 ]; then
    echo "Failed!"
    exit 1
  fi
  touch ".${num}.done"
done

rm .*.done