Copyright © 2001-2018 MultiMedia Soft

WASAPI.DeviceCoreAudioIndexGet method

Previous pageReturn to chapter overviewNext page

Remarks

 

Obtains the zero-based index inside the list of CoreAudio devices of a given WASAPI device.

 

While the list of CoreAudio devices, depending upon the value of the nStateMask parameter of the CoreAudioDevices.Enum method, may not contain devices unplugged or disabled, the list of WASAPI devices will always contain all of the devices installed inside the system, also if currently unplugged or disabled: this methods allows creating a one-to-one correspondence between WASAPI devices and CoreAudio devices.

 

This method is only intended for usage with Windows Vista and later versions.

For further details about the use of WASAPI see the WASAPI object and the How to manage audio flow through WASAPI tutorial.

Further information about management of audio devices in Windows Vista and later versions can be found inside the How to access settings of audio devices in Windows Vista and later versions tutorial.

 

 

Syntax

 

[Visual Basic]

control.WASAPI.DeviceCoreAudioIndexGet (

nDeviceIndex as Integer,

nDeviceType as enumWasapiDeviceTypes,

nIndexCoreAudio as Long

) as enumErrorCodes


 

[C++]

short control.WASAPI.DeviceCoreAudioIndexGet (

short nDeviceIndex,

short nDeviceType,

long *nIndexCoreAudio

);


 

Parameter

Description

 

 

nDeviceIndex

Number representing the zero-based index of the WASAPI device of interest. The total number of available WASAPI devices can be obtained using the WASAPI.DeviceGetCount method.

nDeviceType

The type of device.

Supported values are the following:

Mnemonic Value

Value

Meaning

WASAPI_DEVICE_TYPE_RENDER

0

Audio rendering device.

WASAPI_DEVICE_TYPE_CAPTURE

1

Audio capture device.

nIndexCoreAudio

Reference that, on return from the method call, will contain the zero-based index of the CoreAudio device corresponding to the given WASAPI device.

If the returned value should be set to -1, this would mean that the given WASAPI device wasn't enumerated by a previous call to the CoreAudioDevices.Enum method, probably because currently disabled or unplugged.

 

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred, check the LastError property value in order to get the error code

enumErrorCodes.ERR_NOERROR (0)

The method call was successful