Rockbox mail archive
Subject: Re: mp3 cutting and pasting
From: Johan Vromans (jvromans_at_squirrel.nl)
Date: 2004-08-17
Christopher Moore <christopher.h.moore_at_verizon.net> writes:
> Johan,
> Please send the cuefilemaker.pl script again. The version you sent to the
> rockbox mailing list seems to have vanished.
Okay. Here it is, included as text so you can cut/paste, _and_ as
attachment.
----snip----
#!/usr/bin/perl
# Q&D cue file maker.
# Takes input a file with offsets (in seconds), one per line.
# Offsets can easily be determined with e.g. audacity.
# Minutes and fractions are allowed.
die("Usage: $0 mp3file [ secondsfile | secs1 secs2 ...]\n") unless @ARGV >= 2;
use strict;
print ("PERFORMER \"Unknown\"\n",
"TITLE \"Unknown\"\n",
"FILE \"", shift, "\" WAVE\n");
my $track = 0;
my @t = @ARGV == 1 ? <> : @ARGV;
foreach my $t ( 0, @t ) {
my ($mm, $ss, $ms);
$ms = $t;
$ms = 60 * $1 + $2 if $t =~ /^(\d+):(\d+(?:\.\d+)?)/;
$mm = int($ms / 60);
$ss = int($ms) % 60;
$ms = int(75*$ms) % 75;
printf (" TRACK %02d AUDIO\n", ++$track);
print (" PERFORMER \"Unknown\"\n",
" TITLE \"Unknown\"\n");
printf (" INDEX %02d %02d:%02d:%02d\n",
1, $mm, $ss, $ms);
}
----snip----
-- Johan
_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox
Page was last modified "Jan 10 2012" The Rockbox Crew
|