TROGDOR has asked for the wisdom of the Perl Monks concerning the following question:
The resulting output when run from a command prompt is:use Win32::MediaPlayer; use Cwd; print "Current directory is ". getcwd . "\n"; $winmm = new Win32::MediaPlayer; $winmm->load('c:/dev/roar.mp3'); print "Here.\n"; $length = $winmm->length; print "length is $length\n"; $winmm->volume(100); $winmm->play; print "Done.\n";
When I run this, I hear no sound. I can play the roar.mp3 file in winamp with no problem. The roar.mp3 file is in the same directory as the game.pl file. The odd part is, the length echo is correct. The mp3 file is 1.453 seconds long. So how could the program know the length of the mp3 file if it supposedly did not load correctly?C:\dev>perl game.pl Current directory is C:/dev Here. No File Loaded at C:/Perl/site/lib/Win32/MediaPlayer.pm line 58. length is 1453 No File Loaded at C:/Perl/site/lib/Win32/MediaPlayer.pm line 44. Done.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::MediaPlayer not playing sound
by toolic (Bishop) on Jan 02, 2012 at 01:05 UTC | |
|
Re: Win32::MediaPlayer not playing sound
by BrowserUk (Patriarch) on Jan 02, 2012 at 06:38 UTC | |
|
Re: Win32::MediaPlayer not playing sound
by GrandFather (Saint) on Jan 02, 2012 at 01:49 UTC | |
|
Re: Win32::MediaPlayer not playing sound
by Anonymous Monk on Jan 02, 2012 at 04:11 UTC | |
by Anonymous Monk on Jan 02, 2012 at 04:15 UTC |