NoPaste

wma2mp3.new

von crichton

SNIPPET_TEXT:
  1. #! /usr/bin/perl
  2.  
  3.  ### WMA TO MP3 CONVERTER BY Seraphyn
  4.  ### Start with perl wma2mp3.pl
  5.  
  6.  $dir=`pwd`;
  7.  
  8.  chop($dir);
  9.  
  10.  opendir(checkdir,"$dir");
  11.  
  12.  while ($file=readdir(checkdir)) {
  13.  
  14.  $orig_file=$file;
  15.  
  16.  if ($orig_file !~ /\.wma$/i) {next};
  17.  
  18.  if ($orig_file !~ /\.wma$/i) {next};
  19.  
  20.  print "Checking file: $orig_file\n";
  21.  
  22.  $new_wav_file=$orig_file;$new_wav_file=~s/\.wma/\.wav/;
  23.  $new_mp3_file=$orig_file;$new_mp3_file=~s/\.wma/\.mp3/;
  24.  
  25.  $convert_to_wav="mplayer \"./$orig_file\" -ao pcm:file=\"./$new_wav_file\"";
  26.  $convert_to_mp3="lame -h \"./$new_wav_file\" \"./$new_mp3_file\"";
  27.  $remove_wav="rm -rf \"./$new_wav_file\"";
  28.  
  29.  print "EXEC 1: $convert_to_wav\n";
  30.  $cmd=`$convert_to_wav`;
  31.  print "EXEC 2: $convert_to_mp3\n";
  32.  $cmd=`$convert_to_mp3`;
  33.  print "REMOVE WAV: $remove_wav\n";
  34.  $cmd=`$remove_wav`;
  35.  print "\n\n";
  36.  
  37.  }
  38.  
  39.  print "Fertig.";

Quellcode

Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen. PASTEBIN_DOWNLOAD_SNIPPET_EXPLAIN