Introduction link
To convert WMA format (thanks Microsoft) to MP3 format, you will need “lame”, “mplayer”, and “perl”. You must have the unofficial package repositories configured in Debian to install lame.
Installation link
To install everything once you have the unofficial package repositories configured:
1
| apt-get install lame mplayer perl
|
Then create a file named convert.pl and insert these lines:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
| #! /usr/bin/perl
### WMA TO MP3 CONVERTER
###
$dir=`pwd`;
chop($dir);
opendir(checkdir,"$dir");
while ($file=readdir(checkdir)) {
$orig_file=$file;
if ($orig_file !~ /\.wma$/i) {next};
print "Conversion in progress: $orig_file\n";
$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\" -ao pcm -aofile \"./$new_wav_file\"";
$convert_to_mp3="lame -h \"./$new_wav_file\" \"./$new_mp3_file\"";
$remove_wav="rm -rf \"./$new_wav_file\"";
print "EXEC 1: $convert_to_wav\n";
$cmd=`$convert_to_wav`;
print "EXEC 2: $convert_to_mp3\n";
$cmd=`$convert_to_mp3`;
print "REMOVE WAV: $remove_wav\n";
$cmd=`$remove_wav`;
print "\n\n";
}
print "Done....";
|
Then set the appropriate permissions:
Execute it in the folder containing your WMA files:
Last updated
30 Jan 2007, 14:36 +0200. history