Copyright © 2005-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 unplugged or disabled devices, 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 WASAPIMan class 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]

Public Function DeviceCoreAudioIndexGet (

nDeviceIndex as Int32,

nDeviceType as enumWasapiDeviceTypes,

ByRef nIndexCoreAudio as Int32

) as enumErrorCodes


 

[C#]

public enumErrorCodes DeviceCoreAudioIndexGet (

Int32 nDeviceIndex,

enumWasapiDeviceTypes nDeviceType,

ref Int32 nIndexCoreAudio

);


 

[C++]

public: enumErrorCodes DeviceCoreAudioIndexGet (

Int32 nDeviceIndex,

enumWasapiDeviceTypes nDeviceType,

Int32 __gc  *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 (see the LastError property for further error details)

enumErrorCodes.NOERROR (0)

The method call was successful.