Hey, I have simple 16-bit PCM player that I made using DirectSound. But when it plays, it seems that it plays only one speaker instead of both.
I don't know what code to post exactly, so you'll have to tell me if you need any. I can say that I create the sound buffer using, and lock the stream using:
WAVEFORMATEX wfx; ZeroMemory(&wfx, sizeof(wfx));
LPDIRECTSOUNDBUFFER pDsb = NULL;
memset(&wfx, 0, sizeof(WAVEFORMATEX));
wfx.wFormatTag = WAVE_FORMAT_PCM;
wfx.nChannels = snd->channels;
wfx.nSamplesPerSec = snd->sample_rate;
wfx.nBlockAlign = snd->channels * 2;
wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign;
wfx.wBitsPerSample = 16;
DSBUFFERDESC dsbdesc; ZeroMemory(&dsbdesc, sizeof(dsbdesc));
dsbdesc.dwSize = sizeof(DSBUFFERDESC);
dsbdesc.dwFlags = DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME | DSBCAPS_CTRLFREQUENCY | DSBCAPS_GLOBALFOCUS;
dsbdesc.dwBufferBytes = snd->size;
dsbdesc.lpwfxFormat = &wfx;
SoundMgr->CreateSoundBuffer(&dsbdesc, &pDsb, NULL);
pDsb->QueryInterface(IID_IDirectSoundBuffer8, (LPVOID*)&snd->voice);
pDsb->Release();
DWORD len;
snd->voice->Lock(0, 0, (void**)&snd->data, &len, NULL, NULL, DSBLOCK_ENTIREBUFFER);