Subject: | Will not play music in Windows XP |
I can not get this module to play any music with Windows Media Player. I
used the simplest set up possible to avoid mistakes, however, no music
is forthcoming from Media Player. I have attached the script that I used
to try to play a single song. If this is not a bug, but a bad set up,
please rewrite the description with the correct set up.
Thanks!
Lady_Aleena
Subject: | play_song.pl |
use strict;
use warnings;
use File::Find;
use Win32::MediaPlayer;
my @files;
sub wanted {
my $file = $File::Find::name;
if ($_ =~ /\.mp3$/) {
push @files, $file;
}
}
find(\&wanted,"C:/Documents and Settings/Dawn/My Documents/My Music");
my $winmm = new Win32::MediaPlayer;
$winmm->load($files[rand @files]) or die("load failed $!\n");;
$winmm->play;