Copyright © 2011-2023 MultiMedia Soft

Effects.VolumeAutomationSetScales metjod

Previous pageReturn to chapter overviewNext page

Remarks

 

Sets scale units that will be used when adding/modifying a volume point.

 

For further details about defining a volume automation procedure refer to the How to define a volume automation procedure section.

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

 

 

Syntax

 

[Visual Basic]

Public Function VolumeAutomationSetScales (

nPositionUnit as enumVolumeAutomationPosUnits,

nScaleType as enumVolumeScales

) as enumErrorCodes


 

[C#]

public enumErrorCodes VolumeAutomationSetScales (

enumVolumeAutomationPosUnits nPositionUnit,

enumVolumeScales nScaleType

);


 

[C++]

public: enumErrorCodes VolumeAutomationSetScales (

enumVolumeAutomationPosUnits nPositionUnit,

enumVolumeScales nScaleType

);


 

 

Parameter

Description

 

 

nPositionUnit

The unit used to define positions of volume points in Volume Automation procedures.

Supported values are the following:

Mnemonic constant

Value

Meaning

VA_POS_UNIT_SECONDS

0

Positions are expressed in seconds

VA_POS_UNIT_PERCENTAGE (default)

1

Positions are expressed in percentage

VA_POS_UNIT_MILLISECONDS

2

Positions are expressed in milliseconds

nScaleType

The volume scaling type.

Supported values are the following:

Mnemonic constant

Value

Meaning

SCALE_LINEAR (default)

0

Volume is based upon a linear scale:

- value 0.0 mutes the sound

- values higher than 0.0 and lower 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 lower 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.ERR_NOERROR (0)

The method call was successful.