Platform SDK: DirectX

Step 9: Shut Down DirectSoundCapture

[Visual Basic]

The information in this topic pertains only to applications written in C and C++. See DirectSound Visual Basic Tutorials.

[C++]

Before closing the application you must shut down the capture system. This is a simple matter of releasing all the objects. You must release the IDirectSoundNotify interface before releasing the capture buffer.

void CleanupDSoundCapture(void)
{
    if (lpdsNotify) 
        IDirectSoundNotify_Release(lpdsNotify);    
    if (lpdscb) 
        IDirectSoundCaptureBuffer_Release(lpdscb);
    if (lpdsc) 
        IDirectSoundCapture_Release(lpdsc);
}