 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Frank Guest
|
Posted: Wed Feb 28, 2007 3:41 pm Post subject: Slow PlaySound() |
|
|
Hello,
I have a game written in Delphi 2006 that uses PlaySound() to play some .wav
during the game.
PlaySound() has always worked great on all the O.S. starting from Windows
98, 2000, XP.
Now on an Intel Core 2 CPU with Vista,
PlaySound() is very slow.
It plays the sound, then wait a little bit (one secon)
before playing then other sound.
I use a command similar to the following:
PlaySound(SoundName, hHandle, SND_RESOURCE or SND_ASYNC or SND_NOWAIT or
SND_NODEFAULT);
Do you think it's a problem related to Threads?
How to play .wav in a separate Thread?
Thank you. |
|
| Back to top |
|
 |
Mark Jacobs Guest
|
Posted: Wed Feb 28, 2007 4:29 pm Post subject: Re: Slow PlaySound() |
|
|
Is User Rights Checking under Vista slow enough to make the "wow factor"
unjustified? Could it be checking to see if you have rights to access the
"low-level" hardware that way?
--
Mark Jacobs
DK Computing
http://www.dkcomputing.co.uk
"Frank" <1 (AT) 1 (DOT) com> wrote in message news:45e54e5f$1 (AT) newsgroups (DOT) borland.com...
| Quote: | I have a game written in Delphi 2006 that uses PlaySound() to play some .wav
during the game.
PlaySound() has always worked great on all the O.S. starting from Windows
98, 2000, XP.
Now on an Intel Core 2 CPU with Vista,
PlaySound() is very slow.
It plays the sound, then wait a little bit (one secon)
before playing then other sound.
I use a command similar to the following:
PlaySound(SoundName, hHandle, SND_RESOURCE or SND_ASYNC or SND_NOWAIT or
SND_NODEFAULT);
Do you think it's a problem related to Threads?
How to play .wav in a separate Thread? |
|
|
| Back to top |
|
 |
Guest
|
Posted: Mon Mar 19, 2007 9:31 pm Post subject: Re: Slow PlaySound() |
|
|
I have the same problem using a sound-component from LMD-tools.
That component preloads the sound when the application starts.
In spite of that, the sound plays with a delay every time.
So the problem cannot be slow access to the soundfile on disk.
Palle M. Pedersen
www.cognisoft.dk |
|
| Back to top |
|
 |
Mike Warren Guest
|
Posted: Tue Mar 20, 2007 3:46 am Post subject: Re: Slow PlaySound() |
|
|
Frank wrote:
| Quote: | Hello,
I have a game written in Delphi 2006 that uses PlaySound() to play
some .wav during the game. PlaySound() has always worked great on
all the O.S. starting from Windows 98, 2000, XP.
|
I don't know if this has a bearing on your problem but Vista now
emulates DirectSound in software. This introduces delays that weren't
apparent in XP and earlier. It may be that PlaySound uses DirectSound
under the hood.
--
-Mike |
|
| Back to top |
|
 |
Pete Guest
|
Posted: Tue May 15, 2007 7:15 pm Post subject: Re: Slow PlaySound() |
|
|
Hi Frank,
I have exactly the same problem. Did you ever find a solution?
Pete
Frank wrote:
| Quote: | Hello,
I have a game written in Delphi 2006 that uses PlaySound() to play some .wav
during the game.
PlaySound() has always worked great on all the O.S. starting from Windows
98, 2000, XP.
Now on an Intel Core 2 CPU with Vista,
PlaySound() is very slow.
It plays the sound, then wait a little bit (one secon)
before playing then other sound.
I use a command similar to the following:
PlaySound(SoundName, hHandle, SND_RESOURCE or SND_ASYNC or SND_NOWAIT or
SND_NODEFAULT);
Do you think it's a problem related to Threads?
How to play .wav in a separate Thread?
Thank you.
|
|
|
| Back to top |
|
 |
Mark Jacobs Guest
|
Posted: Sat May 19, 2007 4:48 am Post subject: Re: Slow PlaySound() |
|
|
"Pete" <fesoftware (AT) btconnect (DOT) com> wrote in message
news:4649c078 (AT) newsgroups (DOT) borland.com...
| Quote: | Hi Frank,
I have exactly the same problem. Did you ever find a solution?
|
Perhaps Vista is using some kind of DRM check before playing the sound to
make sure it isn't protected content.
--
Mark Jacobs
http://jacobsm.com |
|
| 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
|
|