Copyright © 2001-2020 MultiMedia Soft

ASIO.DeviceChannelVolumeSet method

Previous pageReturn to chapter overviewNext page

Remarks

 

Sets the volume for a specific input or output ASIO channel.

 

For further details about the use of ASIO drivers see the ASIO object section and the How to manage ASIO drivers tutorial.

 

 

Syntax

 

[Visual Basic]

control.ASIO.DeviceChannelVolumeSet (

nDeviceIndex as Integer,

nChannelIndex as Integer,

bInputChannel as enumBoolean,

fVolume as Single,

nScaleType as enumVolumeScales

) as enumErrorCodes


 

[C++]

short control.ASIO.DeviceChannelVolumeSet (

short nDeviceIndex,

short nChannelIndex,

short bInputChannel,

float fVolume,

short nScaleType

);


 

Parameter

Description

 

 

nDeviceIndex

Number representing the zero-based index of the ASIO device.

This index is related to available ASIO devices so it must be the related to the enumeration performed through the ASIO.DeviceGetCount and ASIO.DeviceGetDesc methods: it must not be confused with indexes related to generic output devices enumerated through the GetOutputDevicesCount and GetOutputDeviceDesc methods which may contain both DirectSound and ASIO devices.

nChannelIndex

Number representing the zero-based index of the ASIO channel of interest

bInputChannel

Boolean value that specifies if the nChannelIndex parameter is related to an input or output channel.

Supported values are the following:

Mnemonic constant

Value

Meaning

BOOL_FALSE

0

Output channel

BOOL_TRUE

1

Input channel

fVolume

New volume expressed in the unit specified by the nScaleType parameter below.

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:

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