#!/usr/bin/perl package main; use Term::ANSIColor; # WMA2mp3: Decode a WMA and make an mp3. $cpr= '#################################################################### # This Perl script is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public # License (as published by the Free Software Foundation) or the # Artistic License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public # License along with this program; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ####################################################################'; # Version $VERSION = 0.1; ## GET READY. print colored ['cyan'], "$0: == GETTING READY ==\n"; # Catch signals. sub catch_zap { my $signame = shift; print colored ['cyan'], "$0: == CLEANING UP ==\n"; unlink $fifo if ($fifo); die "Somebody sent me a SIG$signame"; } $SIG{INT} = \&catch_zap; $SIG{TERM}= \&catch_zap; # Check for prereqs. use Config; my(@path) = split /$Config{'path_sep'}/, $ENV{'PATH'}; foreach (@path) { if (-f "$_/mplayer") { $mplayer = 1; } if (-f "$_/lame") { $lame = 1; } } if (! $mplayer) { die "$0: Can't find MPlayer\n Error"; } if (! $lame) { die "$0: Can't file LAME\n Error"; } # Get command-line options. $help = <&1 |"); while () { print "mplayer: $_" if ($verbose); } while () { print "lame: $_"; } ## CLEAN UP print colored ['cyan'], "$0: == CLEANING UP ==\n"; unlink "$fifo"; =pod =head1 NAME wma2mp3 - Convert a WMA to an MP3 =head1 SYNOPSIS wma2mp3 [options] [wma] [mp3] =head1 DESCRIPTION B converts a WMA to an MP3 (SURPRISE!!!) using L and pipe-ing the audio through L. Don't worry, it doesn't encode in real-time. It accepts various options to specify how it rips, but you usually don't have to use them. =head1 OPTIONS =over 1 =item B<--verbose|-v> Print extra info. =item B<--help|-h> Print this message. =back =head1 EXAMPLES # Encodes to F wma2mp3 movie.wma movie.mp3 # Encodes to F verbosely. wma2mp3 -v movie.wma movie.mp3 =head1 SCRIPT CATEGORIES Audio : MP3 =head1 AUTHOR Michael Howell =head1 COPYRIGHT Copyright (c) 2007 Michael Howell. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO L L =cut