Sign in to follow this  

DirectSound: DSBCAPS_GLOBAL

This topic is 4482 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I created a secondary sound buffer with the flag DSBCAPS_GLOBAL. Despite of that, sounds are stopped if the window looses it's focus. I also tried to use an example from the DirectX SDK and just add the DSBCAPS_GLOBAL flag, but it did not work. What could be the reason?

Share this post


Link to post
Share on other sites
hi there ChristophR,
How are you doing?

The Problem
Sound stops playing on the second buffer as your window looses focus

The Solution
There is an exception for DSBCAPS_GLOBAL
"The buffer is a global sound buffer. With this flag set, an application using DirectSound can continue to play its buffers if the user switches focus to another application, even if the new application uses DirectSound. The one exception is if you switch focus to a DirectSound application that uses the DSSCL_WRITEPRIMARY flag for its cooperative level. In this case, the global sounds from other applications will not be audible. "

You might also want to check if your buffer isn't lost during this switch to another window.
Also if you haven't read this about creating secondary buffers it might help a bit.

I will look a little more into it when I have time. Take care buddy.

Share this post


Link to post
Share on other sites
I know that there is an exception. But that is not the reason in my case, because I switched to the desktop, and the desktop does not use DirectSound at all. There is also no other application running which uses DirectSound.

I also don't think that the buffer is lost during the switch, because if I switch back the sound continues immediately.

Share this post


Link to post
Share on other sites
Ok, I have found the problem. In my own project it works well now. I just set the volume to zero when I tested my setVolume function yesterday and I did not remove the call afterwards.

In the SDK example it still makes troubles. I don't know why, but it seems that the global flag is incompatible with other flags used in that project.

But that does not matter. It works in my project now and that is all I wanted.

Share this post


Link to post
Share on other sites

This topic is 4482 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this