Microsoft DirectX 8.0 (Visual Basic) |
Allocates resources for a buffer created with the DSBCAPS_LOCDEFER flag.
object.AcquireResources( _ lFlags As Long, _ lEffectsResults() As Long)
If the method fails, an error is raised. Possible values for Err.Number include the following:
DSERR_CONTROLUNAVAIL |
DSERR_INVALIDCALL |
DSERR_INVALIDPARAM |
Normally, buffers created with DSBCAPS_LOCDEFER are not given resources until DirectSoundSecondaryBuffer8.Play is called. DirectSoundSecondaryBuffer8.AcquireResources can be used to allocate resources for deferred buffers. By doing so, the application can retrieve information about effects processing and set effect parameters before the buffer is played.
If the method fails, the value for each effect in lEffectsResults is either DSFXF_PRESENT or DSFXR_UNKNOWN. Check these values to determine which effects caused the failure.
A buffer with acquired resources that is not yet playing is not a candidate for premature termination by the voice management flags passed to the Play method.
If AcquireResources is called on a buffer on which it has already been called, the status of the effects is returned but no additional resources are allocated.
Resources are released when playback is stopped.
If an attempt is made to acquire resources for a buffer with the DSBCAPS_LOCHARDWARE flag on a system where hardware acceleration is not available, the method fails with either DSERR_CONTROLUNAVAIL or DSERR_INVALIDCALL, depending on the operating system.