Copyright © 2008-2023 MultiMedia Soft

Effects.FilterApply method

Previous pageReturn to chapter overviewNext page

Remarks

 

Applies a filter effect to the given portion of sound under editing.

 

A successful call to this method will fire the SoundEditStarted event followed by a number of SoundEditPerc events and finally by the SoundEditDone event.

 

For further details about methods related to the use of special effects refer to the EffectsMan class.

 

 

Syntax

 

[Visual Basic]

Public Function FilterApply (

nStartPosition as Int32,

nEndPosition as Int32,

nFilterName as enumFilterNames,

nFilterType as enumFilterTypes,

fFrequency1 as Single,

fFrequency2 as Single,

fGain as Single,

fTransitionTime as Single

) as enumErrorCodes


 

[C#]

public enumErrorCodes FilterApply (

Int32 nStartPosition,

Int32 nEndPosition,

enumFilterNames nFilterName,

enumFilterTypes nFilterType,

float fFrequency1,

float fFrequency2,

float fGain,

float fTransitionTime

);


 

[C++]

public: enumErrorCodes FilterApply (

Int32 nStartPosition,

Int32 nEndPosition,

enumFilterNames nFilterName,

enumFilterTypes nFilterType,

float fFrequency1,

float fFrequency2,

float fGain,

float fTransitionTime

);


 

 

Parameter

Description

 

 

nStartPosition

Start position, expressed in milliseconds, of the affected sound range.

nEndPosition

End position, expressed in milliseconds, of the affected sound range.. If set to -1 the end position will be set to the end of the sound.

nFilterName

Numeric value representing the filter name.

Supported values are the following:

Mnemonic constant

Value

Meaning

FILTER_NAME_BESSEL

0

Bessel IIR Filter

FILTER_NAME_BUTTERWORTH

1

Butterworth IIR Filter

FILTER_NAME_HAMMING

2

Hamming FIR Filter

FILTER_NAME_HANNING

3

Hanning FIR Filter

FILTER_NAME_BLACKMAN

4

Blackman FIR Filter

FILTER_NAME_RECTANGULAR

5

Rectangular FIR Filter

FILTER_NAME_KAISER

6

Kaiser FIR Filter

nFilterType

Numeric value representing the filter type.

Supported values are the following:

Mnemonic constant

Value

Meaning

FILTER_TYPE_LOW_PASS

0

Low Pass Filter

FILTER_TYPE_HIGH_PASS

1

High Pass Filter

FILTER_TYPE_BAND_PASS

2

Band Pass Filter

FILTER_TYPE_BAND_STOP

3

Stop Band Filter

fFrequency1

First corner frequency, expressed in Hertz.

 

For Low Pass and High Pass filters, this parameter represents the cut-off frequency.

For Band Pass and Band Stop filters, this parameter represents the low frequency cut.

The value of this parameter must be higher than 0 and lower than half the frequency of the sound under editing; the frequency of the sound under editing can be obtained through the GetFrequency method.

fFrequency2

Second corner frequency, expressed in Hertz.

 

For Low Pass and High Pass filters, this parameter is ignored and can be set to 0.

For Band Pass and Band Stop filters, this parameter represents the high frequency cut and its value must be higher than 0, higher than the value of the fFrequency1 parameter and lower than half the frequency of the sound under editing; the frequency of the sound under editing can be obtained through the GetFrequency method.

fGain

Gain applied to the filter, expressed in percentage: typically this parameter should be set to 100 which leaves the original sound level unchanged during filtering; values under 100 reduce the sound level while values above 100 amplify the sound level.

 

This parameter is ignored by IIR filters like Bessel and Butterworth.

fTransitionTime

Transition time, expressed in milliseconds, describes how quickly a filter transitions from a pass band to a stop band, or vice versa.

The minimum accepted value is 201 milliseconds.

 

 

This parameter is ignored by IIR filters like Bessel and Butterworth.

 

 

 

Return value

 

Value

Meaning

 

 

Negative value

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

enumErrorCodes.ERR_NOERROR (0)

The method call was successful.