diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-09-18 16:37:23 -0300 |
---|---|---|
committer | Silvio Rhatto <user@example.org> | 2014-09-18 16:37:23 -0300 |
commit | 9cf767abb45d641b832ed0960d53d7bdd4055031 (patch) | |
tree | 568f8dd540fa9d84bb07ddd1ca1293afde8d4f23 | |
download | utils-cdrecord-9cf767abb45d641b832ed0960d53d7bdd4055031.tar.gz utils-cdrecord-9cf767abb45d641b832ed0960d53d7bdd4055031.tar.bz2 |
Initial import
-rw-r--r-- | README.md | 0 | ||||
-rw-r--r-- | TODO.md | 0 | ||||
-rwxr-xr-x | cdrecord | 23 | ||||
-rwxr-xr-x | wav2dao | 71 |
4 files changed, 94 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/README.md diff --git a/cdrecord b/cdrecord new file mode 100755 index 0000000..50cd977 --- /dev/null +++ b/cdrecord @@ -0,0 +1,23 @@ +#!/bin/bash +# +# Record an audio cd based on wav files in a folder +# + +if [ -z "$1" ] && [ -d "$1" ]; then + CWD="`pwd`" + cd $1 +fi + +echo CD_DA > toc + +for file in *.wav; do + echo >> toc + echo TRACK AUDIO >> toc + echo FILE \"$file\" 0 >> toc +done + +cdrdao write --speed 8x --device /dev/cdrom1 toc + +if [ ! -z "$CWD" ]; then + cd $CWD +fi @@ -0,0 +1,71 @@ +#!/usr/bin/perl + +use strict 'subs'; +use strict 'refs'; + +@dev = ('--device', '/dev/pg0:0,0'); + +sub help { + print "Syntax: $0 [-H] [options] audiofiles\n"; + print <<"EOF" ; +Use cdrdao on the wav audio file arguments, making an appropriate toc file. +-d cdrw Use cdrw as the CDRW device (default: $dev[1]). +-o file Output the toc file on this file - do not use a temporary file. +-p Perform a 'print-size' cdrdao command. +-i Perform a 'toc-info' cdrdao command. +-c Perform a 'show-toc' cdrdao command. +-t Perform a 'read-test' cdrdao command. +-w Write the CD in DAO mode (default, if no other action is specified). +-s Simulate writing only ('simulate' instead of 'write' command). +-j Do not eject the CD after writing it. +-n Print the cdrdao commands, instead of executing them. +EOF +} + +require 'getopts.pl'; +&Getopts('o:pictwsjnH'); +if ($opt_H) { &help ; exit } +$dev[1] = $opt_d if $opt_d; +$opt_w = 1 unless $opt_p || $opt_i || $opt_c || $opt_t || $opt_w || $opt_s || $opt_o ne ""; + +die "Usage: $0 [options] audiofiles" unless @ARGV; + +$fname = $opt_o ne "" ? $opt_o : "/tmp/toc$$"; +open(F, "> $fname") || die "open($fname): $!, stopped"; +print F "CD_DA\n"; + +foreach (@ARGV) { + print F "\nTRACK AUDIO\nNO COPY\n"; +# print F "NO PRE_EMPHASIS\nTWO_CHANNEL_AUDIO\n"; + print F "FILE \"$_\" 0\n"; +# print F "START 00:02:00\n" if $no++; +} +close F; + +if ($opt_p) { + if ($opt_n) { print "cdrdao print-size $fname\n" } + else { system 'cdrdao', 'print-size', $fname} +} + +if ($opt_i) { + if ($opt_n) { print "cdrdao toc-info $fname\n" } + else { system 'cdrdao', 'toc-info', $fname} +} + +if ($opt_c) { + if ($opt_n) { print "cdrdao show-toc $fname\n" } + else { system 'cdrdao', 'show-toc', $fname} +} +if ($opt_t) { + if ($opt_n) { print "cdrdao read-test $fname\n" } + else { system 'cdrdao', 'read-test', $fname} +} + +if ($opt_w || $opt_s) { + unshift @dev, $opt_s ? 'simulate' : 'write'; + push @dev, '--eject' unless $opt_s || $opt_j; + push @dev, $fname; + if ($opt_n) { print "cdrdao @dev\n" } else { system 'cdrdao', @dev } +} +unlink $fname unless $opt_o ne ""; +__END__ |