BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Slow PlaySound()

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Multimedia
View previous topic :: View next topic  
Author Message
Frank
Guest





PostPosted: Wed Feb 28, 2007 3:41 pm    Post subject: Slow PlaySound() Reply with 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





PostPosted: Wed Feb 28, 2007 4:29 pm    Post subject: Re: Slow PlaySound() Reply with quote



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






PostPosted: Mon Mar 19, 2007 9:31 pm    Post subject: Re: Slow PlaySound() Reply with quote



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





PostPosted: Tue Mar 20, 2007 3:46 am    Post subject: Re: Slow PlaySound() Reply with quote

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





PostPosted: Tue May 15, 2007 7:15 pm    Post subject: Re: Slow PlaySound() Reply with quote

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





PostPosted: Sat May 19, 2007 4:48 am    Post subject: Re: Slow PlaySound() Reply with quote

"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.