scripts

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

commit 20bfd04a17080d565770b2d0ca47a14ae3edd978
parent f5955b7562685ba54919f0918bf060a7d9d7ac6f
Author: Haris <haris@feanor.lan>
Date:   Wed, 26 Jun 2013 00:04:41 +0300

wavtomp3 for OpenBSD

Diffstat:
Awavtomp3 | 35+++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+), 0 deletions(-)

diff --git a/wavtomp3 b/wavtomp3 @@ -0,0 +1,35 @@ +#!/usr/bin/perl -w + +use strict; +use List::MoreUtils qw (each_array); + +# Program for proper ripping based on OpenBSD's cdio implemenetaion +# Needed: List::MoreUtils +# Usage: # cdio cdrip +# # cdio cddbinfo > list +# And just run the script + +my @files = glob("*.wav"); + + print "Band/artist name is:\t"; + chomp (my $artist = <STDIN>); + print "Album name is:\t\t"; + chomp (my $album = <STDIN>); + print "Album year release:\t"; + chomp (my $year = <STDIN>); + print "Enter genre:\t\t"; + chomp (my $genre = <STDIN>); + +system ("/usr/bin/sed '1,2d;\$d' list > listing"); +my $list = 'listing'; +open (INFO, $list); +my @names = <INFO>; +close (INFO); + +my $all = each_array(@files, @names); + +while (my ($files, $names) = $all->() ) { + my $numbering = substr ($files, 5, 2); + chomp (my $stripped = substr ($names, 17)); + exec `/usr/local/bin/lame -V2 -q0 --tt \"$stripped\" --tn $numbering --ta \"$artist\" --tl \"$album\" --ty $year --tg \"$genre\" $files "$numbering - $stripped.mp3"`; +}