Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
The DSBCAPSstructure specifies the capabilities of a DirectSound buffer object, for use by the IDirectSoundBuffer::GetCapsmethod.
typedef struct { DWORD dwSize ; DWORD dwFlags ; DWORD dwBufferBytes ; DWORD dwUnlockTransferRate ; DWORD dwPlayCpuOverhead ; } DSBCAPS, *LPDSBCAPS; typedef const DSBCAPS *LPCDSBCAPS;
Members
Flag | Description |
---|---|
DSBCAPS_CTRLFREQUENCY | The buffer must have frequency control capability. |
DSBCAPS_CTRLPAN | The buffer must have pan control capability. |
DSBCAPS_CTRLVOLUME | The buffer must have volume control capability. |
DSBCAPS_GETCURRENTPOSITION2 | Indicates that IDirectSoundBuffer::GetCurrentPositionshould use the new behavior of the play cursor. In DirectSound in DirectX 1, the play cursor was significantly ahead of the actual playing sound on emulated sound cards; it was directly behind the write cursor. Now, if the DSBCAPS_GETCURRENTPOSITION2 flag is specified, the application can get a more accurate play position. If this flag is not specified, the old behavior is preserved for compatibility. Note that this flag affects only emulated sound cards; if a DirectSound driver is present, the play cursor is accurate for DirectSound in all versions of DirectX. |
DSBCAPS_GLOBALFOCUS | The buffer is a global sound buffer. With this flag set, an application using DirectSound can continue to play its buffers if the user switches focus to another application, even if the new application uses DirectSound. The one exception is if you switch focus to a DirectSound application that uses the DSSCL_EXCLUSIVE or DSSCL_WRITEPRIMARY flag for its cooperative level. In this case, the global sounds from other applications will not be audible. |
DSBCAPS_LOCHARDWARE | The buffer is in hardware memory and uses hardware mixing. |
DSBCAPS_LOCSOFTWARE | The buffer is in software memory and uses software mixing. |
DSBCAPS_PRIMARYBUFFER | Indicates that the buffer is a primary sound buffer. If this value is not specified, a secondary sound buffer will be created. |
DSBCAPS_STATIC | Indicates that the buffer will be used for static sound data. Typically, these buffers are loaded once and played many times. These buffers are candidates for hardware memory. |
DSBCAPS_STICKYFOCUS | Changes the focus behavior of the sound buffer. This flag can be specified in an IDirectSound::CreateSoundBuffercall. With this flag set, an application using DirectSound can continue to play its sticky focus buffers if the user switches to another application not using DirectSound. In this situation, the application's normal buffers are muted, but the sticky focus buffers are still audible. This is useful for nongame applications, such as movie playback (DirectShow), when the user wants to hear the soundtrack while typing in Microsoft Word or Microsoft Excel, for example. However, if the user switches to another DirectSound application, all sound buffers, both normal and sticky focus, in the previous application are muted. |
Remarks
The DSBCAPSstructure contains information similar to that found in the DSBUFFERDESCstructure passed to the IDirectSound::CreateSoundBuffermethod, 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 The dwFlagsmember of the DSBCAPSstructure contains the same flags used by the DSBUFFERDESCstructure. The only difference is that in the DSBCAPSstructure, either the DSBCAPS_LOCHARDWARE or DSBCAPS_LOCSOFTWARE flag will be specified, according to the location of the buffer memory. In the DSBUFFERDESCstructure, these flags are optional and are used to force the buffer to be located in either hardware or software.
Requirements
Runs On | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 2.12 or later. Version 2.12 requires DXPAK 1.0 or later. | dsound.h |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
See Also
IDirectSound::CreateSoundBuffer, IDirectSoundBuffer::GetCaps