Re: Wave-File gesamtspielzeit bestimmen
Hi,
Lothar Schweikle-Droll hat gesagt: // Lothar Schweikle-Droll wrote:
> ich versuch mich gerade an einem Script, das eine TOC-Datei für cdrdao
> erzeugt, das eine Wave-File mit vielen Indexeinträgen beinhaltet.
>
> Nun such ich eine Programm (Kommandoline) das die Gesamtspielzeit einer
> Wave-Datei ausgibt. Diese Programm muß Script fähig sein.
Spontan fällit mir da "sndinfo" ein, das zu Csound gehört.
$ /usr/bin/sndinfo ~/loops/drum.wav
Using /usr/local/lib/csound.txt
/home/freak/loops/drum.wav: WAVE, 86754 stereo samples
WAVE soundfile
srate 44100, stereo, 16 bit shorts, 1.97 seconds
headersiz 44, datasiz 347016 (86754 sample frames)
Aber es gibt sicher noch andere, schau mal unter www.linux-sound.org
Ich glaube aber, dass cdrdao überhaupt keine Längeninformation
braucht. Ich nehme manchmal das selbstgebaute Skript hier:
#!/usr/bin/perl -w
# mkwavtoc.pl - usage: mkwavtoc.pl *.wav
use strict;
use diagnostics;
my $infile;
print "CD_ROM_XA\n";
my $tpl = "TRACK AUDIO\nFILE \"%\%FILE%%\" 0\n\n";
while (@ARGV) {
$infile = shift @ARGV;
my $fil = { FILE => "$infile"};
print &template($tpl,$fil);
}
sub template
{
my ($text, $fillings) = @_;
# replace quoted words with value in %$fillings hash
$text =~ s{ %% ( .*? ) %% }
{ exists( $fillings->{$1} )
? $fillings->{$1}
: ""
}gsex;
return $text;
} # sub template
ciao
--
Frank Barknecht _ ______footils.org__
Reply to: