use Time::HiRes 'sleep'; use Win32::MediaPlayer; sub sound_play { my $winmm = Win32::MediaPlayer->new(); $winmm->load($alarm_sound); $winmm->play(); my $pos = 0; (-$pos + ($pos = $winmm->pos)) or return while sleep 0.1; }
The relative order of load and play and pos are important here, but I've forgotten why. I think it worked fine in a forked process.
In reply to Re: Win32::Sound problem
by Anonymous Monk
in thread Win32::Sound problem
by cypress
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |