Microsoft DirectX 8.0 (Visual Basic) |
Sets effects for sounds in the buffer. The buffer must not be playing.
object.SetFX( _ EffectsCount As Long, _ Buffers() As DSEFFECTDESC, _ lResultIDs() As Long)
If the method fails, an error is raised and Err.Number may be set to one of the following error values.
DSERR_CONTROLUNAVAIL |
DSERR_GENERIC |
DSERR_INVALIDPARAM |
DSERR_INVALIDCALL |
DSERR_NOINTERFACE |
DSERR_PRIOLEVELNEEDED |
For the method to succeed, the buffer must have been created with the DSBCAPS_CTRLFX flag and must not be playing.
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.
If the method returns DSERR_NOINTERFACE or another COM error, check the result code array for DSFXR_PRESENT or DSFXR_UNKNOWN to ascertain which effect caused the error. If the method returns DSERR_INVALIDPARAM, check the result codes for DSFXR_FAILED to see which effects failed to acquire resources.
If the buffer is part of an audiopath, the audiopath must be inactive. See DirectMusicAudioPath8.Activate.
An effect must be set on a buffer before the effect object can be obtained. To obtain the effect object, use DirectSoundSecondaryBuffer8.GetObjectInPath.