Sarang Lakare wrote:
>
> nice script! I really like it!
>
> but hey, how do i add some spacing in between those songs?
>
> -sarang
This puts 2 seconds of space as it is.
To change the amount of space, add
-padsize=20k
or whatever. (At 16-bit samples, stereo = 4 bytes/sample, and 44.1
samples/second, there should be about 200 bytes per second, so a padsize
of around 400 should be roughly equal to the default . . . but this is
all theory, you understand; I've never actually messed with it myself.
That lovely script does nothing but capture the music porition of the
CD-writing HOWTO into a simple script.
As noted by another correspondent, it falls apart if you have files with
spaces in the names (I don't--I have another scripts that substibutes
underscores for all such file names becuase spaces are inconvenient in
Linux in a number of ways), and it fails for a CD-RW (unless it happens
to be new).
(But why on earth would you burn CDs for your car/office/Walkman on
CD-RW??? It never occurred to me that anybody would. Certainly *I*
never would.)
My "unmsdos" script, by the way, and it's campanion script, "uncrnl",
are attached.
The "rated names" part of the unmsdos script was this totally quirky
concept that even I later ditched for having a sort of "attachment" at
the end of a file name, noted with a leading :, that I didn't want the
script to munge.
Many of you may find it "overly eager," it takes out all "funny"
characters; that is, all characters magic to the shells, from file names
to make them easier to work with. If the file is a text file, it
changes CR/NL sequences to NL. I run it over fils that come from the MS
world to "Linuxify" them. You may love it or hate it . . . it works for
me.
It is quite handy to run over your mp3's before running my writecd
script, but could mess you up if you already have them in data bases
with their current names.
--
"Brian, the man from babble-on" [EMAIL PROTECTED]
Brian T. Schellenberger http://www.babbleon.org
Support http://www.eff.org. Support decss defendents.
Support http://www.programming-freedom.org. Boycott amazon.com.
#! /usr/bin/perl
if ($ARGV[0] eq '-c') # Special CD-ROM mode
{
$cdrom = 1;
}
if ($ARGV[0] eq '-n')
{
shift;
$putname = 1;
}
foreach (@ARGV)
{
# unmsdos accpets a "quoting" convention of angle-brackets to
# quote names. If it has 'em, strip 'em. If it has the leading,
# but not the trailing, bracket then save this one and come
# around again. First see if we are continued from before.
if ($pending)
{
$_ = $pending . ' ' .$_;
$pending = "";
}
if (/^</)
{
if (/>$/)
{
s/^<//;
s/>$//;
}
else
{
$pending = $_;
next;
}
}
$path = $_;
$path = "." if (! /\//);
$path =~ s|/[^/]*$||;
s|^.*/||;
$newname = $_;
if ($cdrom)
{
next if (length > 12 || /[a-z]/); # 12 = 8.3 (12345678.ABC)
goto justLowercase;
}
# If it's one of my "rated" names, seperate out the rating part.
# Always take out leading paths for file renames.
$prefix = "";
if (/^(.*\/)?(\w+-\w+-\w+:)?/)
{
$prefix = $&;
$_ = $';
}
# name conversions.
$newname =~ tr/\x80-\xFF/\x00-\x7F/;
$newname =~ s/[\x00- ]/_/g;
$newname =~ s/[[\]]/_/g;
$newname =~ s/\&/+/g;
$newname =~ s/\s/_/g;
$newname =~ s/^~/_/g;
$newname =~ s/^\+/p_/g;
$newname =~ s/([^.])~/$1-/g;
$newname =~ s/;/@/g;
$newname =~ s/[ `'"!&*$;]/_/g;
$newname =~ s/\$/_/g;
$newname =~ s/[:{}|()]/-/g;
$newname =~ s/^-/_/;
$newname =~ s/\?/q/g;
$newname =~ s/#/=/g;
$newname =~ s/\\/_/g;
justLowercase:
$newname =~ tr/A-Z/a-z/;
if ($putname)
{
print "$newname\n";
next;
}
$newname = $path . "/" . $newname;
$_ = $path . "/" . $_;
if ($newname ne $_)
{
print "$_ -> $newname\n";
if (-e $prefix . $newname)
{
print STDERR "$newname already exists; can't rename\n";
}
else
{
if (rename($prefix . $_, $prefix . $newname))
{
$_ = $newname;
}
else
{
print STDERR "Rename to $newname failed.\n";
}
}
}
# Changes to file contents . . .
$_ = $prefix . $_;
if (-T $_ && !cdrom)
{
if (system('uncrnl', $_)/256 == 0)
{
print "Uncrnl'ed $_\n";
}
else
{
print STDERR "Uncrnl $_ failed.\n";
}
}
}
#! /bin/tcsh -f
# set echo
if ("$1" =~ */*) then
set plc = $1:h
set file = $1:t
cd $plc
else
set file = $1
endif
mv $file }$file}
tr < }$file} > $file -d '\r'