Copyright © 2006-2018 MultiMedia Soft

WASAPI.DeviceGetCount method

Previous pageReturn to chapter overviewNext page

Remarks

 

Retrieves the number of WASAPI devices currently installed inside the system.

The friendly name of each WASAPI device can be obtained using the WASAPI.DeviceGetDesc method.

 

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.

 

 

Syntax

 

[Visual Basic]

Public Function DeviceGetCount (

nDeviceType as enumWasapiDeviceTypes,

ByRef nDevicesCount as Int32

) as enumErrorCodes


 

[C#]

public enumErrorCodes DeviceGetCount (

enumWasapiDeviceTypes nDeviceType,

ref Int32 nDevicesCount

);


 

[C++]

public: enumErrorCodes DeviceGetCount (

enumWasapiDeviceTypes nDeviceType,

Int32 __gc *nDevicesCount

);


 

 

Parameter

Description

 

 

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.

WASAPI_DEVICE_TYPE_LOOPBACK

2

Audio loopback device.

nDevicesCount

Reference that, on return from the method call, will contain the number of devices for the given device type.

 

 

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.