scripts

misc scripts and tools
git clone git://git.2f30.org/scripts.git
Log | Files | Refs

wavtomp3 (976B)


      1 #!/usr/bin/perl -w
      2 
      3 use strict;
      4 use List::MoreUtils qw (each_array);
      5 
      6 # Program for proper ripping based on OpenBSD's cdio implemenetaion
      7 # Needed: List::MoreUtils
      8 # Usage:	# cdio cdrip
      9 #			# cdio cddbinfo > list
     10 #			And just run the script
     11 
     12 my @files = glob("*.wav");
     13 
     14 	print "Band/artist name is:\t";
     15 	chomp (my $artist = <STDIN>);
     16 	print "Album name is:\t\t";
     17 	chomp (my $album = <STDIN>);
     18 	print "Album year release:\t";
     19 	chomp (my $year = <STDIN>);
     20 	print "Enter genre:\t\t";
     21 	chomp (my $genre = <STDIN>);
     22 
     23 system ("/usr/bin/sed '1,2d;\$d' list > listing");
     24 my $list = 'listing';
     25 open (INFO, $list);
     26 my @names = <INFO>;
     27 close (INFO);
     28 
     29 my $all = each_array(@files, @names);
     30 
     31 while (my ($files, $names) = $all->() ) {
     32 	my $numbering = substr ($files, 5, 2);
     33 	chomp (my $stripped = substr ($names, 17));
     34 	exec `/usr/local/bin/lame -V2 -q0 --tt \"$stripped\" --tn $numbering --ta \"$artist\" --tl \"$album\" --ty $year --tg \"$genre\" $files "$numbering - $stripped.mp3"`;
     35 }