SecondaryBuffer.AcquireResources(Int32,Int32) Method (Microsoft.DirectX.DirectSound)

Allocates resources for a SecondaryBuffer object that was created with the DeferLocation flag set in the BufferDescription.


Visual BasicPublic Function AcquireResources( _
    ByVal flags As Integer, _
    ByVal effectsCount As Integer _
) As EffectsReturnValue()
C#public EffectsReturnValue[] AcquireResources(
    int flags,
    int effectsCount
array<EffectsReturnValue>^ AcquireResources(
    int flags,
    int effectsCount
JScriptpublic function AcquireResources(
    flags : int,
    effectsCount : int
) : EffectsReturnValue[];


flags System.Int32
Specifies how resources are to be allocated for the SecondaryBuffer object. For a list of values, see the voice management and voice allocation flags in the BufferPlayFlags enumeration.
effectsCount System.Int32
Number of Microsoft DirectSound effect objects in the SecondaryBuffer set by the SetEffects method.

Return Value

An array that contains one element for each of the DirectSound effect objects that was assigned to the SecondaryBuffer object by the SetEffects method. One of the following values is returned for each DirectSound effect object.


In order to use the BufferPlayFlags enumeration in the flags parameter, you must cast it to an integer, as done in the following code.

[C#]int flags = (int)(BufferPlayFlags.LocateInSoftware | BufferPlayFlags.TerminateByTime);
EffectsReturnValue[] returnval = buffer.AcquireResources(flags,1);

If the DeferLocation flag is not set in the BufferDescription of the SecondaryBuffer object, an InvalidCallException is thrown.

If one of the BufferPlayFlags is set in the flags parameter and is not supported, a ControlUnavailableException is thrown.