Copyright © 2005-2011 MultiMedia Soft

StreamVolumeSet method

Previous pageReturn to chapter overviewNext page

Remarks

 

Changes the volume for the given player: changing this volume will not affect the volume of other players. The current volume can be retrieved through the StreamVolumeGet method.

This method is ignored and returns a ERR_PLAYER_BUSY error when called during a volume sliding started by a volume automation procedure or by the embedded fader.

 

 

Syntax

 

[Visual Basic]

Public Function StreamVolumeSet (

nPlayerIndex as Int16,

nVolume as float,

nScaleType as enumVolumeScales

) as enumErrorCodes


 

[C#]

public enumErrorCodes StreamVolumeSet (

Int16 nPlayerIndex,

float nVolume,

enumVolumeScales nScaleType

);


 

[C++]

public: enumErrorCodes StreamVolumeSet (

Int16 nPlayerIndex,

float nVolume,

enumVolumeScales nScaleType

);


 

 

Parameter

Description

 

 

nPlayerIndex

Number representing the zero-based index of the involved player

nVolume

Number representing the new volume (the meaning of the passed value depends upon the nScaleType parameter).

nScaleType

The volume scaling type.

Supported values are the following:

Mnemonic value

Value

Meaning

SCALE_LINEAR

0

The passed volume is based upon a linear scale and can be in the range from 0.0 (silence) to 100.0 (max volume)

SCALE_LOG

1

The passed volume, expressed in dB, is based upon a logarithmic scale and can be in the range from -100  (silence) to 0 (max volume)

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.