makecdrfiles

By Hal Canary, 2007-03-23 11:52:20 (link)
#computers-code

Some years ago, cdrecord gained the ability to convert .wav files to an audio CD on the fly. No more messing around with sox! But I've found that it's better to feed files through sox anyways, just to make sure that the file format is correct and the sampling rate is correct:

#!/bin/sh

# makecdrfiles - Convert mp3s to
# .cdr format for an audio CD.
# Copyright 2000-2007 Hal Canary
# Dedicated to the Public Domain.

if [ "$#" -lt 1 ] ; then
  echo "  Useage: $0 file.mp3 [more files.mp3]"
  echo ""
  echo "  After you're done, burn with:"
  echo -n '   sudo cdrecord -v -dao -eject dev=$DEV'
  echo ' -pad -audio *.cdr'
  exit 1
fi
for FILE in "$@" ; do
  nice lame --decode "$FILE" - | \
    nice sox -t wav - "$(basename $FILE .mp3).cdr"
done

I burnt four coasters today before I figured this out.


(back)