Creating a Capture Buffer

Create a capture buffer for storing sound data by creating a CaptureBuffer object.

The capture buffer can be specified directly using the CaptureBuffer(IntPtr,Capture) constructor, or a new capture buffer can be created with the CaptureBuffer(CaptureBufferDescription,Capture) constructor, which takes a CaptureBufferDescription structure that specifies the characteristics of the desired buffer. The Format member of this structure is a WaveFormat structure, which must be initialized with the details of the desired WAV format.

Note that if your application is using Microsoft DirectSound playback as well as DirectSound capture, capture buffer creation can fail when the format of the capture buffer is not the same as that of the primary buffer. The reason is that some cards have only a single clock and cannot support capture and playback at two different frequencies.