Windows: Make DirectSound buffer global to allow sound to be played, even if other applications like Steam are brought to the foreground.

This commit is contained in:
The Dax 2013-06-20 12:50:10 -04:00
parent e6fb1b2e1a
commit 32bedefe20

View File

@ -49,7 +49,7 @@ namespace DSound
pcmwf.wBitsPerSample = 16; pcmwf.wBitsPerSample = 16;
dsbdesc.dwSize = sizeof(DSBUFFERDESC); dsbdesc.dwSize = sizeof(DSBUFFERDESC);
dsbdesc.dwFlags = DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_STICKYFOCUS; // //DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME | DSBCAPS_CTRLFREQUENCY; dsbdesc.dwFlags = DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_GLOBALFOCUS; // //DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME | DSBCAPS_CTRLFREQUENCY;
dsbdesc.dwBufferBytes = bufferSize = BUFSIZE; //FIX32(pcmwf.wf.nAvgBytesPerSec); //change to set buffer size dsbdesc.dwBufferBytes = bufferSize = BUFSIZE; //FIX32(pcmwf.wf.nAvgBytesPerSec); //change to set buffer size
dsbdesc.lpwfxFormat = (WAVEFORMATEX *)&pcmwf; dsbdesc.lpwfxFormat = (WAVEFORMATEX *)&pcmwf;