Package com.ms.com.directX Previous
Previous
Microsoft Packages
Microsoft Packages
Index
Index
Next
Next

Class DSBCaps

public final class DSBCaps {
  public int dwSize;
  public int dwFlags;
  public int dwBufferBytes;
  public int dwUnlockTransferRate;
  public int dwPlayCpuOverhead;
}

Specifies the capabilities of a DirectSound buffer object, for use by the GetCaps method.

See also dSoundBuffer.

Fields

dwSize
Size of this class, in bytes.
dwFlags
One or more values of DSBCAPS_ type that specify buffer-object capabilities.
dwBufferBytes
Size of this buffer, in bytes.
dwUnlockTransferRate
Specifies the rate, in kilobytes per second, that data is transferred to the buffer memory when Unlock is called. High-performance applications can use this value to determine the time required for Unlock to execute. For software buffers located in system memory, the rate will be very high since no processing is required. For hardware buffers, the rate may be slower because the buffer might have to be downloaded to the sound card, which may have a limited transfer rate.
dwPlayCpuOverhead
Specifies the processing overhead as a percentage of main processing cycles needed to mix this sound buffer. For hardware buffers, this field will be 0 because the mixing is performed by the sound device. For software buffers, this field depends on the buffer format and the speed of the system processor.

The DSBCaps class contains information similar to that found in the DSBufferDesc class passed to the CreateSoundBuffer method, with some additional information. Additional information includes the location of the buffer (hardware or software) and some cost measures (such as the time to download the buffer if located in hardware, and the processing overhead to play the buffer if it is mixed in software).

Note that the dwFlags field contains the same flags used by the DSBufferDesc class. The only difference is that in the DSBCaps class, either the DSBCAPS_LOCHARDWARE or DSBCAPS_LOCSOFTWARE flag will be specified, according to the location of the buffer memory. In the DSBufferDesc class, these flags are optional and are used to force the buffer to be located in either hardware or software.

Top© 1996 Microsoft Corporation. All rights reserved.