Platform SDK: DirectX

CONST_DSBCAPSFLAGS

The CONST_DSBCAPSFLAGS enumeration is used in the lFlags member of the DSBCAPS and DSBUFFERDESC types to specify buffer capabilities.

Enum CONST_DSBCAPSFLAGS
    DSBCAPS_CTRL3D              =     16 (&H10)
    DSBCAPS_CTRLFREQUENCY       =     32 (&H20)
    DSBCAPS_CTRLPAN             =     64 (&H40)
    DSBCAPS_CTRLPOSITIONNOTIFY  =    256 
    DSBCAPS_CTRLVOLUME          =    128 (&H80)
    DSBCAPS_GETCURRENTPOSITION2 =  65536 (&H10000)
    DSBCAPS_GLOBALFOCUS         =  32768 (&H8000)
    DSBCAPS_LOCHARDWARE         =      4 
    DSBCAPS_LOCSOFTWARE         =      8 
    DSBCAPS_MUTE3DATMAXDISTANCE = 131072 (&H20000)
    DSBCAPS_PRIMARYBUFFER       =      1 
    DSBCAPS_STATIC              =      2 
    DSBCAPS_STICKYFOCUS         =  16384 (&H4000)
End Enum
DSBCAPS_CTRL3D
The buffer uses 3-D control.
DSBCAPS_CTRLFREQUENCY
The buffer must have frequency control capability.
DSBCAPS_CTRLPAN
The buffer must have pan control capability.
DSBCAPS_CTRLPOSITIONNOTIFY
The buffer must have position notification capability. See Remarks.
DSBCAPS_CTRLVOLUME
The buffer must have volume control capability.
DSBCAPS_GETCURRENTPOSITION2
This indicates that DirectSoundBuffer.GetCurrentPosition should use the new behavior of the play cursor. Always set this flag in DirectX for Visual Basic applications
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 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 are not audible.
DSBCAPS_LOCHARDWARE
This forces the buffer to use hardware mixing. If the device does not support hardware mixing or if the required hardware memory is not available, the call to the DirectSound.CreateSoundBuffer method fails. The application must ensure that a mixing channel will be available for this buffer; this condition is not guaranteed.
DSBCAPS_LOCSOFTWARE
This forces the buffer to be stored in software memory and use software mixing, even if DSBCAPS_STATIC is specified and hardware resources are available.
DSBCAPS_MUTE3DATMAXDISTANCE
The buffer will stop playing when the maximum distance is exceeded, so that processor time is not wasted.
DSBCAPS_PRIMARYBUFFER
This indicates that the buffer is a primary sound buffer. If this value is not specified, a secondary sound buffer is created.
DSBCAPS_STATIC
This indicates that the buffer should be placed in memory on the sound card, if available. This is not the same as DSBCAPS_LOCHARDWARE, which forces the buffer to be placed in memory, usually system memory, managed by the driver.
DSBCAPS_STICKYFOCUS
This changes the focus behavior of the sound buffer. An application using DirectSound can continue to play such buffers if the user switches to an application that is 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 when the user wants to hear the soundtrack while using another application. However, if the user switches to a DirectSound application, all sound buffers, both normal and sticky focus, in the previous application are muted.

Remarks

On VxD drivers, if a sound buffer is created with DSBCAPS_CTRLPOSITIONNOTIFY, this buffer is always a software buffer. This is because the VxD driver model doesn't support the notify interface. With WDM drivers, a position notification enabled buffer may be in hardware, if hardware is available. Calling DirectSoundBuffer.Play with the DSBPLAY_LOCHARDWARE flag will fail when playing a buffer created with this flag set.

Sound buffers created with the DSBCAPS_CTRLPOSITIONNOTIFY flag must set a notification event. If you create a sound buffer with the NOTIFY flag, but don't set any notifications, the behavior is undefined. You may experience sounds being played twice. Therefore, applications should not use DSBCAPS_CTRLPOSITIONNOTIFY unless they set a notification event.