Microsoft DirectX 9.0 SDK Update (October 2004)

Setting Effects on Buffers

Language:

Note: This documentation is preliminary and is subject to change.

Any number of effects can be set on a secondary buffer that was created with the BufferCaps.ControlEffects property. Effects might not work smoothly on very small buffers, and Microsoft® DirectSound® does not permit the creation of effects-capable buffers that hold less than 150 (BufferSize.FxMin) milliseconds of data.

To implement an effect on a buffer, use the SecondaryBuffer.SetEffects method. This method takes an array of EffectDescription structures that describe the effects. You can also use SetEffects to remove effects, by passing a null reference instead of an array. In either case, the buffer must not be playing.

Effects can be instantiated in hardware (that is, implemented by the sound card driver) or in software. For more information, see EffectDescription.

The following Microsoft Visual Basic® sample function sets the standard echo effect on a buffer.
[Visual Basic .NET]
Private Sub SetEcho(ByVal b As SecondaryBuffer) Dim fx As EffectDescription() ReDim fx(0) fx(0).GuidEffectClass = DSoundHelper.StandardEchoGuid Try b.SetEffects(fx) Catch e As ControlUnavailableException Debug.WriteLine("BufferDescription does not have ControlEffects set.") End Try End Sub

© 2004 Microsoft Corporation. All rights reserved. Terms of use.

Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center