title: Playing Stereo PCM with DirectSound
body: <p>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.</p>
  
  <p>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:</p>
  
  <pre><code> WAVEFORMATEX wfx;  ZeroMemory(&amp;wfx, sizeof(wfx));
   LPDIRECTSOUNDBUFFER pDsb = NULL;
  
   memset(&amp;wfx, 0, sizeof(WAVEFORMATEX)); 
   wfx.wFormatTag = WAVE_FORMAT_PCM; 
   wfx.nChannels = snd-&gt;channels; 
   wfx.nSamplesPerSec = snd-&gt;sample_rate; 
   wfx.nBlockAlign = snd-&gt;channels * 2; 
   wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; 
   wfx.wBitsPerSample = 16; 
  
   DSBUFFERDESC dsbdesc; ZeroMemory(&amp;dsbdesc, sizeof(dsbdesc));
  
   dsbdesc.dwSize = sizeof(DSBUFFERDESC); 
   dsbdesc.dwFlags = DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME | DSBCAPS_CTRLFREQUENCY | DSBCAPS_GLOBALFOCUS; 
   dsbdesc.dwBufferBytes = snd-&gt;size; 
   dsbdesc.lpwfxFormat = &amp;wfx; 
  
   SoundMgr-&gt;CreateSoundBuffer(&amp;dsbdesc, &amp;pDsb, NULL); 
  
   pDsb-&gt;QueryInterface(IID_IDirectSoundBuffer8, (LPVOID*)&amp;snd-&gt;voice);
   pDsb-&gt;Release();
  
   DWORD len;
   snd-&gt;voice-&gt;Lock(0, 0, (void**)&amp;snd-&gt;data, &amp;len, NULL, NULL, DSBLOCK_ENTIREBUFFER);
  </code></pre>