XInputGetAudioDeviceIds function (xinput.h)

Retrieves the sound rendering and sound capture audio device IDs that are associated with the headset connected to the specified controller.

Syntax

DWORD XInputGetAudioDeviceIds(
  [in]                DWORD  dwUserIndex,
  [out, optional]     LPWSTR pRenderDeviceId,
  [in, out, optional] UINT   *pRenderCount,
  [out, optional]     LPWSTR pCaptureDeviceId,
  [in, out, optional] UINT   *pCaptureCount
);

Parameters

[in] dwUserIndex

Index of the gamer associated with the device.

[out, optional] pRenderDeviceId

Windows Core Audio device ID string for render (speakers).

[in, out, optional] pRenderCount

Size, in wide-chars, of the render device ID string buffer.

[out, optional] pCaptureDeviceId

Windows Core Audio device ID string for capture (microphone).

[in, out, optional] pCaptureCount

Size, in wide-chars, of capture device ID string buffer.

Return value

If the function successfully retrieves the device IDs for render and capture, the return code is ERROR_SUCCESS.

If there is no headset connected to the controller, the function will also retrieve ERROR_SUCCESS with NULL as the values for pRenderDeviceId and pCaptureDeviceId.

If the controller port device is not physically connected, the function will return ERROR_DEVICE_NOT_CONNECTED.

If the function fails, it will return a valid Win32 error code.

Remarks

Callers must allocate the memory for the buffers passed to XInputGetAudioDeviceIds. The resulting strings can be of arbitrary length.

Platform Requirements

Windows 8 (XInput 1.4)

Requirements

Requirement Value
Target Platform Windows
Header xinput.h
Library Xinput.lib
DLL Xinput1_4.dll

See also

Core Audio APIs

XInput Functions

XInputGetDSoundAudioDeviceGuids