[plug] Split a 1.3GB file in half

Carl Gherardi carl.gherardi at gmail.com
Mon Oct 3 13:44:43 WST 2005


>
> Gurus,
>
> What's the easiest way for me to chop a 1.3GB file (2 hr MP3 decoded
> back into WAV) in half? I want to split it across two CDs and my car
> stereo doesn't support MP3


Hey Matthew.

There is no need to split the file at all. If its already in wav you can use
a toc sheet to tell your burner to start at the desired part of the file. I
used to do this to add tracks to long voice recordings.

To burn using a toc file:

cdrdao write --device 0,0,0 --speed $speed --driver $driver --eject '$toc'

>From the directory where the toc and the audio are

(NOTE: The following were written well before mp3 burning was drag and drop,
and while still learning to program. Provided for reference only.)

I used the following script to create a toc file that added 5 minute track
gaps to long recordings.

preptoc.pl
---------------------------------
#!/usr/bin/perl

use strict;

my($af, $len, $afmin,$afsec, $last, $min);

@ARGV == 2 or die("usage: preptoc.pl audiofile length\n");

$af = shift;
$len = shift;

($afmin,$afsec) = split(/\./,$len);

open(TOC, ">$af.toc");
print "opening $af.toc for writing\n";
print "afmin: ".$afmin." afsec ".$afsec." len: ".$len."\n";
print TOC "CD_DA\n\n";

$min = 0;

while ($min + 10 <= $afmin)
{
print TOC "TRACK AUDIO\n";
print TOC "NO COPY\n";
print TOC "NO PRE_EMPHASIS\n";
print TOC "TWO_CHANNEL_AUDIO\n";
print TOC "FILE \"$af\" $min:0:0 5:0:0\n\n";
$min += 5;
}

$last = $afmin - $min;
print TOC "TRACK AUDIO\n";
print TOC "NO COPY\n";
print TOC "NO PRE_EMPHASIS\n";
print TOC "TWO_CHANNEL_AUDIO\n";
print TOC "FILE \"$af\" $min:0:0 $last:$afsec:0\n";

close(TOC);
------------------------------
It produces a file something like:

CD_DA


TRACK AUDIO
NO COPY
NO PRE_EMPHASIS
TWO_CHANNEL_AUDIO
FILE "file.wav" 0:0:0 5:0:0


TRACK AUDIO
NO COPY
NO PRE_EMPHASIS
TWO_CHANNEL_AUDIO
FILE "file.wav" 5:0:0 5:0:0


TRACK AUDIO
NO COPY
NO PRE_EMPHASIS
TWO_CHANNEL_AUDIO
FILE "file.wav" 10:0:0 5:0:0

The FILE line being the useful bit.

Whole process used to be:
lame --decode '$mp3' '$mp3'.wav
sox '$mp3'.wav -r 44100 '$mp3'-new.wav resample
normalize -m *.wav
preptoc
burn from toc.

Hope that helps.

Carl G
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20051003/5fe6bac1/attachment.html>


More information about the plug mailing list