sulfericacid has asked for the wisdom of the Perl Monks concerning the following question:
It works great with Wav playback but I have run into a problem. While running this on Windows XP's command prompt, it'll load the song and play it BUT it will not allow anything else to continue until the song is done. This is to say, I want to print stuff to screen during the wav playback but it's just not pushing through.
Anyone have suggestions on how to get around this?
UPDATE: The solution is adding SND_ASYNC to the file open. Win32::Sound::Play($song, SND_ASYNC); does the trick.
#!/usr/bin/perl use warnings; use strict; use Win32::Sound; my $song = "one.wav"; Win32::Sound::Play($song); my $num = 0; for (1 .. 35) { $num++; print "$num\n"; sleep(1); if ($num == 30) { Win32::Sound::Stop(); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::Sound with text
by GrandFather (Saint) on Oct 15, 2005 at 01:43 UTC | |
| |
|
Re: Win32::Sound with text
by Skeeve (Parson) on Oct 14, 2005 at 23:34 UTC |