Страница 1 из 1

Проигрывание *.wma в Linux

Добавлено: 30 янв 2004, 00:55
Geophics
Какой прогой можно производить сабж? Или можно настроить существующие плейеры?

Добавлено: 30 янв 2004, 08:57
Llama
mplayer умеет. но лутше не пользоваться закрытыми форматами. есть скрипт, который конвертирует wma в ogg.

Добавлено: 31 янв 2004, 02:52
Geophics
Супер! И где же надыбать этот скрипт?

Добавлено: 31 янв 2004, 12:39
kostaLom
Сомневаюсь, чтобы это был скрипт.

Добавлено: 31 янв 2004, 14:10
Llama
#!/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