Copyright © 2006-2019 MultiMedia Soft

ASIO.DeviceChannelVolumeGet method

Previous pageReturn to chapter overviewNext page

Remarks

 

Obtains the volume for a specific input or output ASIO channel. This volume can be modified through the ASIO.DeviceChannelVolumeSet method.

 

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

 

 

Syntax

 

[Visual Basic]

Public Function DeviceChannelVolumeGet (

nDeviceIndex as Int16,

nChannelIndex as Int16,

bInputChannel as Boolean,

nScaleType as enumVolumeScales

) as Single


 

[C#]

public float DeviceChannelVolumeGet (

Int16 nDeviceIndex,

Int16 nChannelIndex,

bool bInputChannel,

enumVolumeScales nScaleType

);


 

[C++]

public: float DeviceChannelVolumeGet (

Int16 nDeviceIndex,

Int16 nChannelIndex,

bool bInputChannel,

enumVolumeScales 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 input devices enumerated through the GetInputDevicesCount and GetInputDeviceDesc 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

Meaning

false

Output channel

true

Input channel

nScaleType

The volume scaling type.

Supported values are the following:

Mnemonic constant

Value

Meaning

SCALE_LINEAR

0

Returned volume, expressed in percentage, is based upon a linear scale:

- value 0.0 means that channel is muted

- values higher than 0.0 and smaller than 100.0 attenuate the channel volume

- value 100.0 keeps original sound level unchanged

- values higher than 100.0 amplify the sound level

SCALE_LOG

1

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

- value -100.0 means that channel is muted

- values higher than -100.0 and smaller than 0.0 attenuate the channel volume

- value 0.0 keeps original sound level unchanged

- values higher than 0.0 amplify the sound level

 

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)

>= 0

The current channel volume