Copyright © 2001-2008 MultiMedia Soft 
Return to Table of contents  
 
SetPlayerVolumeEx method 
 
Remarks 
 
Changes the volume for the given player using a higher resolution than the SetPlayerVolume method: changing this volume will not affect the volume of other players. 
 
 
Syntax 
 
[Visual Basic] 
control.SetPlayerVolumeEx
nPlayer as Integer
fValue as single, 
nScaleType as enumVolumeScales 
 
[C++] 
short control.SetPlayerVolumeEx
short nPlayer
float fValue, 
short nScaleType 
);
 
 
Parameter
Description
 
 
nPlayer
Number representing the zero-based index of the player whose volume will change
nValue
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 constant
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: 
float e = 2.7182818281f; 
float exp = (float)((fVolumeInDB + (20 * log(100))) / 20); 
fVolumeLinear = (float) pow (e, exp);
 
 
Return value 
 
Value
Meaning
 
 
Negative value
An error occurred (see the LastError property for further error details)
enumErrorCodes.ERR_NOERROR (0)
The volume has been changed correctly