Copyright © 2005-2018 MultiMedia Soft

Effects.DirectXEffectParamsSet method (Compressor)

Return to chapter overview

Remarks

 

Sets parameters related to the Compressor effect. The current parameters for the chosen effect can be retrieved using the Effects.DirectXEffectParamsGet 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.

 

 

Syntax

 

[Visual Basic]

Public Function DirectXEffectParamsSet (

nPlayerIndex as Int16,

ByRef fx as Microsoft.DirectX.DirectSound.EffectsCompressor

) as enumErrorCodes


 

[C#]

public enumErrorCodes DirectXEffectParamsSet (

Int16 nPlayerIndex,

ref Microsoft.DirectX.DirectSound.EffectsCompressor fx

);


 

[C++]

public: enumErrorCodes DirectXEffectParamsSet (

Int16 nPlayerIndex,

Microsoft::DirectX::DirectSound::EffectsCompressor __gc *fx

);


 

 

Parameter

Description

 

 

nPlayerIndex

Number representing the zero-based index of the involved player

fx

Effect structure containing parameters to apply.

Property

Meaning

 

 

Attack

Retrieves and sets the time before compression reaches its full value.

Can range from CompressorEffect.AttackMin to CompressorEffect.AttackMax.

The default value is 10 ms.

Gain

Retrieves and sets the output gain of signal after compression.

Can range from CompressorEffect.GainMin to CompressorEffect.GainMax.

The default value is 0 dB.

Predelay

Retrieves and sets the time after Threshold is reached before attack phase is started, in milliseconds.

Can range from CompressorEffect.PredelayMin to CompressorEffect.PredelayMax.

The default value is 4 ms.

Ratio

Retrieves and sets the compression ratio.

Can range from CompressorEffect.RatioMin to CompressorEffect.RatioMax.

The default value is 3, which means 3:1 compression.

Release

Retrieves and sets the speed at which compression is stopped after input drops below Threshold.

Can range from CompressorEffect.ReleaseMin to CompressorEffect.ReleaseMax.

The default value is 200 ms.

Threshold

Retrieves and sets the point at which compression begins.

Can range from CompressorEffect.ThresholdMin to CompressorEffect.ThresholdMax.

The default value is -20 dB.

 

 

Return value

 

Value

Meaning

 

 

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.