Проигрывание *.wma в Linux
- Geophics
- Заглянувший
- Сообщения: 37
- Зарегистрирован: 27 янв 2004, 01:51
- Откуда: Минск
- Контактная информация:
Проигрывание *.wma в Linux
Какой прогой можно производить сабж? Или можно настроить существующие плейеры?
#!/usr/bin/perl
#You should just run this from the directory where the files
#you want to convert are located. But you can also optionally
#just specify the path here.
opendir (ENCDIR, "./");
@dirlist = grep {/\.wma$/} readdir (ENCDIR);
closedir ENCDIR;
#These are just used for specifying the names to use when encoding
#to ogg. You can change them to whatever you want.
$album = "The Eminem Show";
$artist = "Eminem";
foreach (@dirlist) {
# These next two lines are very specific to the filenames you're using.
# If you know a little bit of perl, you can modify them for your use.
# Otherwise, I'd suggest just doing it by hand.
$tracknum = substr($_,0,2);
$trackname = substr($_,3,-4);
print "Converting $_ to WAV...";
`mplayer -ao pcm -aofile encodeme.wav "$_" 2>/dev/null`;
print "done!\n";
print "Encoding to ogg:\n";
print " Number: $tracknum\n";
print " Track : $trackname\n";
`oggenc -a $artist -N $tracknum -t "$trackname" -l "$album" -n "\%a -
\%t.ogg" encodeme.wav`;
print "done!\n\n";
}
Для работы в системе должен быть mplayer и vorbis-tools
#You should just run this from the directory where the files
#you want to convert are located. But you can also optionally
#just specify the path here.
opendir (ENCDIR, "./");
@dirlist = grep {/\.wma$/} readdir (ENCDIR);
closedir ENCDIR;
#These are just used for specifying the names to use when encoding
#to ogg. You can change them to whatever you want.
$album = "The Eminem Show";
$artist = "Eminem";
foreach (@dirlist) {
# These next two lines are very specific to the filenames you're using.
# If you know a little bit of perl, you can modify them for your use.
# Otherwise, I'd suggest just doing it by hand.
$tracknum = substr($_,0,2);
$trackname = substr($_,3,-4);
print "Converting $_ to WAV...";
`mplayer -ao pcm -aofile encodeme.wav "$_" 2>/dev/null`;
print "done!\n";
print "Encoding to ogg:\n";
print " Number: $tracknum\n";
print " Track : $trackname\n";
`oggenc -a $artist -N $tracknum -t "$trackname" -l "$album" -n "\%a -
\%t.ogg" encodeme.wav`;
print "done!\n\n";
}
Для работы в системе должен быть mplayer и vorbis-tools
Опыт растет прямо пропорционально выведенному из строя оборудованию