This topic is now archived and is closed to further replies.



Recommended Posts

Right, so I''m trying to set up a basic scheme using DirectSoundCapture where all it''s doing so far is creating an IDirectSoundCapture8 object and a related IDirectSoundCaptureBuffer8. Checking all the return values, everything works perfectly. However, when I call IDirectSoundCaptureBuffer8::Start(), it says it works, but nothing happens. When I subsequently call IDirectSoundCapture8::GetStatus(), it returns 0, indicating it''s not doing anything. Any clue why this doesn''t work? Source: #include #include LPDIRECTSOUNDCAPTURE8 pDSC; LPDIRECTSOUNDCAPTUREBUFFER pCBtemp; LPDIRECTSOUNDCAPTUREBUFFER8 pCB; DirectSoundCaptureCreate8(&DSDEVID_DefaultCapture, &pDSC, NULL); DSCBUFFERDESC bdesc; ZeroMemory(&bdesc, sizeof(bdesc)); bdesc.dwSize = sizeof(bdesc); WAVEFORMATEX wfmt; ZeroMemory(&wfmt, sizeof(wfmt)); wfmt.wFormatTag = WAVE_FORMAT_PCM; wfmt.nChannels = 1; wfmt.nSamplesPerSec = 22050; wfmt.wBitsPerSample = 16; wfmt.nBlockAlign = 2; // (wBitsPerSampe/8) * nChannels wfmt.nAvgBytesPerSec = 44100; // nSamplesPerSec * nBlockAlign bdesc.lpwfxFormat = &wfmt; bdesc.dwBufferBytes = wfmt.nAvgBytesPerSec * 200; pDSC->CreateCaptureBuffer(&bdesc, &pCBtemp, NULL); pCBtemp->QueryInterface(IID_IDirectSoundCaptureBuffer8,(LPVOID*)&pCB); pCBtemp->Release(); pCB->Start(0); DWORD status; status = pCB->GetStatus(&status); cout< This must be linked to both dsound.lib and dxguid.lib. I''m using MSVC++ 6.0 with a Win32 console application. Any ideas as to why status==0?

Share this post

Link to post
Share on other sites