Audio-ConvTools
view release on metacpan or search on metacpan
bin/audioconv view on Meta::CPAN
#!/usr/bin/perl
################################################################################
# Convert audiofiles from one format to another (ogg, mp3 or wav) #
# #
# Copyright (C) 2006 Michael Hooreman <michael_AT_mijoweb_DOT_net> #
################################################################################
#$Id: audioconv,v 1.4 2006-10-28 10:24:21 michael Exp $
=head1 NAME
audioconv - Conversion beteen misc audio file formats
=head1 SYNOPSIS
audioconv [--help] --in mp3|ogg|wav --out mp3|ogg|wav file1 [file2 [...]]
--in : input format, one of mp3, ogg or wav (case insensitive)
--out: output format, one of mp3, ogg or wav (case insensitive)
in and out formats must be differents
example:
audioconv --in mp3 --out ogg test.mp3
=head1 DESCRIPTION
C<audioconv> Provides miscellaneous tools to convert audio files between
Ogg Vorbis, MPEG III and Wav files.
=head2 PROGRAMS USED
To do the conversions, this program uses the following linux programs:
=over
=item *
mpg321, tested with version 0.2.10
=item *
oggdec, tested with version 1.0.1
=back
=cut
=head1 SEE ALSO
L<Audio::ConvTools>
=head1 AUTHOR
Michael Hooreman C<< <mhooreman at skynet.be> >>
=head1 BUGS
Please report any bugs or feature requests to
C<bug-audioconv-tools at rt.cpan.org>, or through the web interface at
L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Audio::ConvTools>.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Audio::ConvTools
bin/audioconv view on Meta::CPAN
$converter = \&mp32wav;
last SWITCH;
};
($inFmt eq "ogg" and $outFmt eq "wav") and do{
$converter = \&ogg2wav;
last SWITCH;
};
($inFmt eq "wav" and $outFmt eq "ogg") and do{
$converter = \&wav2ogg;
last SWITCH;
};
($inFmt eq "wav" and $outFmt eq "mp3") and do{
$converter = \&wav2mp3;
last SWITCH;
};
die("Assertion error: we don't have to come here!");
};
}
sub allowedFormat($)
{
my $fmt = shift;
return 0 unless defined $fmt;
return 1 if $fmt eq "ogg";
return 1 if $fmt eq "mp3";
return 1 if $fmt eq "wav";
return 0;
}
sub runConversions()
{
logMsg("Beginnning of the conversions");
foreach my $f (@listFiles) {
my $st;
logMsg("Converting $f");
if (&$converter($f)) {
logMsg("Conversion of $f done");
} else {
errMsg("Problem while converting $f");
}
}
logMsg("End of the conversions");
}
sub showCopyrights()
{
print "audioconv $VERSION - Conversion beteen misc audio file formats$/";
print $/;
print "Copyright (C) 2006 Michael Hooreman <michael_AT_mijoweb_DOT_net>$/";
print "Licensed under the terms of the GNU General Public Licence$/";
print $/;
}
showCopyrights();
parseCmdline();
runConversions();
__END__
#$Log: audioconv,v $
#Revision 1.4 2006-10-28 10:24:21 michael
#Updated my email address.
#Changed to version 0.08
#
#Revision 1.3 2006-08-18 12:50:12 mhoo
#module is now Audio::ConvTool
#switched to version 0.06
#
#Revision 1.2 2006/08/18 12:28:28 mhoo
#AudioConvTools becomes Audio::ConvTools
#switched to v0.4
#
#Revision 1.1.1.2 2006/08/18 11:46:28 mhoo
#Version 0.9 Ready for CPAN
#
( run in 3.014 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )