Copyright © 2005-2018 MultiMedia Soft

Effects.DirectXEffectParamsSetDistortion method

Previous pageReturn to chapter overviewNext page



Sets parameters related to the Distortion effect. The current parameters for the chosen effect can be retrieved using the Effects.DirectXEffectParamsGetDistortion method.


DirectX effects requires the availability of DirectX version 8 or higher on the target system and can be applied only if the IsDirectX8Available method returns TRUE.


See the How to apply special effects to a playing sound section for further details.




[Visual Basic]

Public Function DirectXEffectParamsSetDistortion (

nPlayerIndex as Int16,

ByRef fx as Microsoft.DirectX.DirectSound.EffectsDistortion

) as enumErrorCodes



public enumErrorCodes DirectXEffectParamsSetDistortion (

Int16 nPlayerIndex,

ref Microsoft.DirectX.DirectSound.EffectsDistortion fx




public: enumErrorCodes DirectXEffectParamsSetDistortion (

Int16 nPlayerIndex,

Microsoft::DirectX::DirectSound::EffectsDistortion __gc *fx









Number representing the zero-based index of the involved player


Reference to the effect structure containing parameters to apply.






Retrieves and sets the percentage of distortion intensity, in the EffectsDistortion structure.

Can range from DistortionEffect.EdgeMin to DistortionEffect.EdgeMax.

The default value is 15.


Retrieves and sets the amount of signal change after distortion, in the EffectsDistortion structure.

Can range from DistortionEffect.GainMin to DistortionEffect.GainMax.

The default value is -18 dB.


Retrieves and sets the width of frequency band that determines range of harmonic content addition, in the EffectsDistortion structure.

Can range from DistortionEffect.PostEqBandwidthMin to DistortionEffect.PostEqBandwidthMax.

The default value is 2400Hz.


Retrieves and sets the center frequency of harmonic content addition, in the EffectsDistortion structure.

Can range from DistortionEffect.PostEqCenterFrequencyMin to DistortionEffect.PostEqCenterFrequency.

The default value is 2400 Hz.


Retrieves and sets the filter cutoff for high-frequency harmonics attenuation, in the EffectsDistortion structure.

Can range from DistortionEffect.PreLowpassCutoffMin to DistortionEffect.PreLowpassCutoffMax.

The default value is 15.



Return value






Negative value

An error occurred (see the LastError property for further error details)

Note that if you should fill the fx structure with values out of range, you could get an exception of type ArgumentException

enumErrorCodes.NOERROR (0)

The method call was successful.