 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Simon Elliott Guest
|
Posted: Thu Jan 05, 2006 3:27 pm Post subject: Windows PlaySound () strangeness |
|
|
I always thought that I understood the Windows PlaySound() API function:
With the flag SND_ASYNC, the sound is played asynchronously and
PlaySound() returns immediately after beginning the sound.
with the flag SND_SYNC, PlaySound() returns after the sound event
completes.
However I've been testing some code which calls PlaySound() from within
a thread, with SND_SYNC set, and the PlaySound() call returns long
before the sound has finished playing. For a 60 second sound, the
PlaySound() call returns after less than 500 milliseconds. In fact,
it's behaving a lot like it should with SND_ASYNC.
This is happening both on a W2K box with SP4, and XP with SP2. Has
anyone else seen this?
--
Simon Elliott http://www.ctsn.co.uk
|
|
| Back to top |
|
 |
Simon Elliott Guest
|
Posted: Thu Jan 05, 2006 3:53 pm Post subject: Re: Windows PlaySound () strangeness |
|
|
On 05/01/2006, I wrote:
(some stuff about PlaySound())
On further investigation this was due to a race condition in my code
which set the "PlaySound() finished" flag before PlaySound() had
actually finished...
--
Simon Elliott http://www.ctsn.co.uk
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|