wma, m4a usw. nach mp3 umwandeln

Post Reply
Message
Author
arthur

wma, m4a usw. nach mp3 umwandeln

#1 Post by arthur »

hi leutz,
hab hier vor wochen eine frage zur umwandlung von versch. audio formaten nach mp3 gestellt. nach langer suche im inet hab ich ein script gefunden, das die umwandlung mit mplayer bewerkstellig.
hier der link zu org. home page:

http://www.linuxeinsteiger.info/anleitu ... edia15.php

man kann das script auch für andere formate benutzen, die der mplayer unterstützt.

hier zwei bespiele für wma und m4a umwandlung.
ich habe zusätzlich die nojoystick option des mplayer verwendet und die lame optionen verändert.


wma nach mp3:

#! /usr/bin/perl

### WMA TO MP3 CONVERTER BY Seraphyn
### Start with perl wma2mp3.pl

$dir=`pwd`;

chop($dir);

opendir(checkdir,"$dir");

while ($file=readdir(checkdir)) {

$orig_file=$file;

if ($orig_file !~ /\.wma$/i) {next};

print "Checking file: $orig_file
";

$new_wav_file=$orig_file;$new_wav_file=~s/\.wma/\.wav/;
$new_mp3_file=$orig_file;$new_mp3_file=~s/\.wma/\.mp3/;

$convert_to_wav="mplayer \"./$orig_file\" -nojoystick -ao pcm -aofile \"./$new_wav_file\"";
$convert_to_mp3="lame -q 0 -V 0 --vbr-new \"./$new_wav_file\" \"./$new_mp3_file\"";
$remove_wav="rm -rf \"./$new_wav_file\"";

print "EXEC 1: $convert_to_wav
";
$cmd=`$convert_to_wav`;
print "EXEC 2: $convert_to_mp3
";
$cmd=`$convert_to_mp3`;
print "REMOVE WAV: $remove_wav
";
$cmd=`$remove_wav`;
print "

";

}

print "Fertig.";


m4a nach mp3

#! /usr/bin/perl

### M4A TO MP3 CONVERTER BY Seraphyn
### Start with perl m4a2mp3.pl

$dir=`pwd`;

chop($dir);

opendir(checkdir,"$dir");

while ($file=readdir(checkdir)) {

$orig_file=$file;

if ($orig_file !~ /\.m4a$/i) {next};

print "Checking file: $orig_file
";

$new_wav_file=$orig_file;$new_wav_file=~s/\.m4a/\.wav/;
$new_mp3_file=$orig_file;$new_mp3_file=~s/\.m4a/\.mp3/;

$convert_to_wav="mplayer \"./$orig_file\" -nojoystick -ao pcm -aofile \"./$new_wav_file\"";
$convert_to_mp3="lame -q 0 -V 0 --vbr-new \"./$new_wav_file\" \"./$new_mp3_file\"";
$remove_wav="rm -rf \"./$new_wav_file\"";

print "EXEC 1: $convert_to_wav
";
$cmd=`$convert_to_wav`;
print "EXEC 2: $convert_to_mp3
";
$cmd=`$convert_to_mp3`;
print "REMOVE WAV: $remove_wav
";
$cmd=`$remove_wav`;
print "

";

}

print "Fertig.";

vielen dank an seraphyn für die vorlage !!!!!!

viel spaß beim umwandeln

Danke

Re: wma, m4a usw. nach mp3 umwandeln

#2 Post by Danke »

stellt eine frage, bekommt keine antwort und findet es dann doch noch selber heraus und postet es dann auch noch.
das ist doch mal ein DANKE wert im gegensatz zu so vielen schwachposts hier.
danke sehr nett @arthur :)

Post Reply