On Fri, Nov 20, 2020 at 4:31 PM Frank Elsner frank.elsner@mailbox.org wrote:
If it carrys an ISO9660 file system simpy mount it and play with any player.
No that's not what I meant by reading.
I meant before you actually write to a disc, you have to have the data from your original disc somewhere right ?
What would you use to record that from the original disc ? That's what I meant.
Sorry for the confusion.
On 11/20/20 3:40 PM, Sreyan Chakravarty wrote:
On Fri, Nov 20, 2020 at 4:31 PM Frank Elsner <frank.elsner@mailbox.org mailto:frank.elsner@mailbox.org> wrote:
If it carrys an ISO9660 file system simpy mount it and play with any player.No that's not what I meant by reading.
I meant before you actually write to a disc, you have to have the data from your original disc somewhere right ?
What would you use to record that from the original disc ? That's what I meant.
Sorry for the confusion.
You mean you want to copy the info off the CD and then re-record it? Below is an old script I used to use to do this. Easily adaptable. Everything is done with cdrdao.
I'll attach another one that I use to convert CDs to flac for my music server. That one uses cdparanoia to rip the CD.
Riki
############################################################################################
#!/bin/bash #TODO: #Need to add an option for setting raw read or raw-subchan read
CDRDAO=`which cdrdao 2>/dev/null`; if [ -z "$CDRDAO" ]; then echo "This script uses the cdrdao utility. It does not appear to be in your path."; exit 1; fi
READ_DEVICE='/dev/sr0'; WRITE_DEVICE='/dev/sr0'; DRIVER="generic-mmc";
PROG=`basename $0`;
function printUsage { cat <<EOF ####################################################################### USAGE: $PROG [-h] [-r READDEVICE] [-w WRITEDEVICE] [FILENAME] $PROG copies the cd in READDEVICE to one in WRITEDEVICE. The user can choose the speed at which the copy is made, and multiple copies can be made from a single read.
Argument: FILENAME: The filename to use for storage of the CD image, toc, etc. Defaults to "cd".
Options: -d: Driver to use with cdrdao [defaults to generic-mmc] -D: Show default drivers and exit. -h: Print this message -p: Set cdrdao --paranoia-mode [defaults to 0] -r: Set the read device [defauts to $READ_DEVICE] -R: --read-raw -s: Set write speed [defaults to 1x] -w: Set the write device [defauts to $WRITE_DEVICE] -y: Assume yes (skip prompts). The mentioned defaults may not make sense for your system. They can be changed in $0. EOF }
#Option processing OPTIONS=""; VERBOSE=""; DEBUG=""; SPEED=""; YES=""; PARANOIA="0"; RAW="";
while getopts ":d:Dp:r:Rs:w:y" opt; do case $opt in d ) DRIVER="$OPTARG";; D ) echo "Read: $READ_DEVICE"; echo "Write: $WRITE_DEVICE"; exit 0;; p ) PARANOIA="$OPTARG";; r ) READ_DEVICE="$OPTARG";; R ) RAW="--read-raw";; s ) SPEED="$OPTARG";; w ) WRITE_DEVICE="$OPTARG";; y ) YES="YES";; ? ) printUsage; exit 1;; esac done
shift $(($OPTIND - 1));
if [ -z $1 ]; then filename=cd; else filename=$1; fi
if [ -z "$YES" ]; then echo "Insert CD into DVD drive..."; read TEMP; fi
if [ -f /tmp/$filename.toc ]; then rm -f /tmp/$filename.toc; fi if [ -f /tmp/$filename.bin ]; then rm /tmp/$filename.bin; fi
echo "Reading from $READ_DEVICE, mode $PARANOIA";
cdrdao read-cd --paranoia-mode $PARANOIA $RAW --datafile /tmp/$filename.bin --device $READ_DEVICE --driver $DRIVER /tmp/$filename.toc
if [ "$?" != "0" ]; then echo "Disk read failed!!"; exit 1; fi
if [ -z "$SPEED" ]; then if [ -z "$YES" ]; then echo -n "CD Copied. Insert blank disk into Plextor drive and "; echo "Select speed for write..." SPEED=""; while [ -z "$SPEED" ]; do select SPEED in 1 4 8 16; do if [ $SPEED ]; then break; else SPEED=1; break; fi done done else SPEED="1"; fi fi
if grep -q 'DISC_ID ""' /tmp/$filename.toc; then cp /tmp/$filename.toc /tmp/$filename.toc2; grep -v DISC_ID /tmp/$filename.toc2 > /tmp/$filename.toc; rm /tmp/$filename.toc2; fi
WRITE="Yes"; while [ "$WRITE" = "Yes" ]; do echo "Writing to $WRITE_DEVICE at speed $SPEED"; cdrdao write -n --eject --device $WRITE_DEVICE --speed $SPEED --driver $DRIVER /tmp/$filename.toc if [ "$?" != "0" ]; then echo "Disk write failed!!"; exit 1; fi
echo "Write another?" select WRITE in "Yes" "No"; do break; done done
rm /tmp/$filename.bin /tmp/$filename.toc;
##########################################################################################