XInputGetAudioDeviceIds function

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

Syntax

DWORD XInputGetAudioDeviceIds(
  DWORD  dwUserIndex,
  LPWSTR pRenderDeviceId,
  UINT   *pRenderCount,
  LPWSTR pCaptureDeviceId,
  UINT   *pCaptureCount
);

Parameters

dwUserIndex

Index of the gamer associated with the device.

pRenderDeviceId

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

pRenderCount

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

pCaptureDeviceId

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

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

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

See Also

Core Audio APIs

XInput Functions

XInputGetDSoundAudioDeviceGuids