#! /usr/bin/perl ### mp3 and wma to ogg by darklinux presents ###no warrenty use warnings; use File::Find (); $dir=`pwd`; chomp($dir); opendir(CHECKDIR,"$dir"); while ($file=readdir(CHECKDIR)) { $orig_file=$file; if($orig_file =~ m/\.mp3$/i) { print "Checking file: $orig_file\n"; $new_wav_file=$orig_file;$new_wav_file=~s/\.mp3/\.wav/; $new_ogg_file=$orig_file;$new_ogg_file=~s/\.mp3/\.ogg/; $convert_to_wav="mplayer \"./$orig_file\" -ao pcm -aofile \"./$new_wav_file\""; $convert_to_ogg="oggenc -q 4 \"./$new_wav_file\" \"./$new_ogg_file\""; $remove_wav="rm -rf \"./$new_wav_file\""; $remove_mp3="rm -rf \"./$orig_file\""; print "EXEC 1: $convert_to_wav\n"; $cmd=`$convert_to_wav`; print "EXEC 2: $convert_to_ogg\n"; $cmd=`$convert_to_ogg`; print "REMOVE WAV: $remove_wav\n"; $cmd=`$remove_wav`; print "REMOVE MP3: $remove_mp3\n"; $cmd=`$remove_mp3`; print "\n\n"; } elsif($orig_file =~ m/\.wma$/i) { print "Checking file: $orig_file\n"; $new_wav_file=$orig_file;$new_wav_file=~s/\.wma/\.wav/; $new_ogg_file=$orig_file;$new_ogg_file=~s/\.wma/\.ogg/; $convert_to_wav="mplayer \"./$orig_file\" -ao pcm -aofile \"./$new_wav_file\""; $convert_to_ogg="oggenc -q5 \"./$new_wav_file\" \"./$new_ogg_file\""; $remove_wav="rm -rf \"./$new_wav_file\""; $remove_wma="rm -rf \"./$orig_file\""; print "EXEC 1: $convert_to_wav\n"; $cmd=`$convert_to_wav`; print "EXEC 2: $convert_to_ogg\n"; $cmd=`$convert_to_ogg`; print "REMOVE WAV: $remove_wav\n"; $cmd=`$remove_wav`; print "REMOVE WMA: $remove_wma\n"; $cmd=`$remove_wma`; print "\n\n"; } elsif ($orig_file =~ m/\.mpc$/i) { print "Checking file: $orig_file\n"; $new_wav_file=$orig_file;$new_wav_file=~s/\.mpc/\.wav/; $new_ogg_file=$orig_file;$new_ogg_file=~s/\.mpc/\.ogg/; $convert_to_wav="mppdec \"./$orig_file\" \"./$new_wav_file\""; $convert_to_ogg="oggenc -q5 \"./$new_wav_file\" \"./$new_ogg_file\""; $remove_wav="rm -rf \"./$new_wav_file\""; $remove_mpc="rm -rf \"./$orig_file\""; print "EXEC 1: $convert_to_wav\n"; $cmd=`$convert_to_wav`; print "EXEC 2: $convert_to_ogg\n"; $cmd=`$convert_to_ogg`; print "REMOVE WAV: $remove_wav\n"; $cmd=`$remove_wav`; print "REMOVE MPC: $remove_mpc\n"; $cmd=`$remove_mpc`; print "\n\n"; } } use Qt; my $a = Qt::Application(\@ARGV); my $quit = Qt::PushButton("Fertig", undef); $quit->resize(100, 30); $quit->setFont(Qt::Font("Times", 18, &Qt::Font::Bold)); $a->connect($quit, SIGNAL('clicked()'), SLOT('quit()')); $a->setMainWidget($quit); $quit->show; exit $a->exec;