No sound from sdl app on win32 when window not active

Is there any way to get sound even when the window is
inactive I’m just making myself a little mp3 player
and it’s very inconvinient that the sound stops when
the window is inactive (in the background).

If it’s impossible to do this without changing the
source, could somenone please tell me where in the
source of sdl this happens, sdl_mixer perhaps?__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

Hello Syver !

Thats because normally SDL uses when it is available DirectSound.
At DS the Sound Output is always connected to a special window to get
as little latency as possible. If you want to use WaveOut instead of DS look at this:

http://www.libsdl.org/faq/FAQ-General.html#GENERAL_AUDIODRIVER

CU

“Syver Enstad” schrieb im Newsbeitrag news:mailman.1003626005.1922.sdl at libsdl.org…> Is there any way to get sound even when the window is

inactive I’m just making myself a little mp3 player
and it’s very inconvinient that the sound stops when
the window is inactive (in the background).

If it’s impossible to do this without changing the
source, could somenone please tell me where in the
source of sdl this happens, sdl_mixer perhaps?


Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

Thats because normally SDL uses when it is available DirectSound.
At DS the Sound Output is always connected to a special window to get
as little latency as possible. If you want to use WaveOut instead of DS
look at this:

http://www.libsdl.org/faq/FAQ-General.html#GENERAL_AUDIODRIVER

You can also get DirectSound to not turn off the sound by adding the flag
DSBCAPS_STICKYFOCUS as shown below.

format.dwFlags |= DSBCAPS_STICKYFOCUS;
result = IDirectSound_CreateSoundBuffer(sndObj, &format, sndbuf, NULL);

I’ve tested it and it works fine on my machine.
This might be nice to have as an option in SDL.

Syver Enstad wrote:

You can also get DirectSound to not turn off the sound by adding the flag
DSBCAPS_STICKYFOCUS as shown below.

format.dwFlags |= DSBCAPS_STICKYFOCUS;
result = IDirectSound_CreateSoundBuffer(sndObj, &format, sndbuf, NULL);

it certainly would be preferred for me. SDL games/apps are the only ones
that mute when i go to check on something else.

Syver Enstad wrote:

You can also get DirectSound to not turn off the sound by adding the flag
DSBCAPS_STICKYFOCUS as shown below.

format.dwFlags |= DSBCAPS_STICKYFOCUS;
result = IDirectSound_CreateSoundBuffer(sndObj, &format, sndbuf, NULL);

it certainly would be preferred for me. SDL games/apps are the only ones
that mute when i go to check on something else.

You got it! It’s in CVS.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment