Copyright © 2008-2011 MultiMedia Soft

Effects.VolumeSlidingApply method

Previous pageReturn to chapter overviewNext page

Remarks

 

Applies a linear sliding volume to the given song's range.

 

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 Effects COM object.

 

 

Syntax

 

[Visual Basic]

control.Effects.VolumeSlidingApply (

nStartPosition as Long,

nEndPosition as Long,

nAffectedChannel as enumChannels,

fInitialVolume as Single,

fFinalVolume as Single,

nScaleType as enumVolumeScales

) as enumErrorCodes


 

[C++]

short control.Effects.VolumeSlidingApply (

long nStartPosition,

long nEndPosition,

short nAffectedChannel,

float fInitialVolume,

float fFinalVolume,

short nScaleType

);


 

 

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.

nAffectedChannel

Numeric value that determines the stereo channel affected by the volume change

Supported values are the following:

Mnemonic constant

Value

Meaning

CHANNELS_BOTH

0

Both left and right channels will be affected

CHANNELS_LEFT

1

Only left channel will be affected

CHANNELS_RIGHT

2

Only right channel will be affected

fInitialVolume

Floating point value representing the sliding initial volume

fFinalVolume

Floating point value representing the sliding final volume

nScaleType

The volume scaling type.

Supported values are the following:

Mnemonic constant

Value

Meaning

SCALE_LINEAR

0

The passed volume is based upon a linear scale:

- value 0.0 mutes the sound

- values higher than 0.0 and smaller than 100.0 attenuate the sound

- value 100.0 keeps sound level unchanged

- values higher than 100.0 amplify the sound

SCALE_LOG

1

The passed volume, expressed in dB, is based upon a logarithmic scale:

- value -100.0 mutes the sound

- values higher than -100.0 and smaller than 0.0 attenuate the sound

- value 0.0 keeps sound level unchanged

- values higher than 0.0 amplify the sound

 

The actual applied formula for converting a linear volume into a logarithmic volume is the following:

VolumeInDB = 20 * log10 (VolumeLinear/100)

The C syntax for converting a logarithmic volume into a linear volume is the following:

VolumeLinear = 100 * pow (10, VolumeInDB/20);

 

 

Return value

 

Value

Meaning

 

 

Negative value

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

enumErrorCodes.NOERROR (0)

The method call was successful.