Skip to main content

XUserGetDefaultAudioEndpointUtf16

Retrieves the default audio endpoint for a specific user.

Syntax

Parameters

user   
Type: XUserLocalId
The local ID of the user to get the default audio endpoint for.
defaultAudioEndpointKind   
Type: XUserDefaultAudioEndpointKind
An enumeration value that specifies whether the user’s default audio endpoint renders or captures audio.
endpointIdUtf16Count   
Type: size_t
The wchar_t count of the buffer that the endpointIdUtf16 parameter points to. Pass XUserAudioEndpointMaxUtf16Count.
endpointIdUtf16   _Out_writes_to_(endpointIdUtf16Count,endpointIdUtf16Used)
Type: wchar_t

Contains the ID of the user’s default audio endpoint.
endpointIdUtf16Used   _Out_opt_
Type: size_t*
Contains the actual wchar_t count of the ID that the endpointIdUtf16 parameter returns.

Return value

Type: HRESULT Returns S_OK if successful; otherwise, returns an error code. For a list of error codes, see Error Codes.

Remarks

This function isn’t safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.
The XUserGetDefaultAudioEndpointUtf16 function takes an XUserDefaultAudioEndpointKind enumeration as an argument. The XUserDefaultAudioEndpointUtf16ChangedCallback callback function invokes when the default audio endpoint for a specific user changes. To register to receive a callback when the default audio endpoint changes, call XUserRegisterForDefaultAudioEndpointUtf16Changed. To un-register to receive a callback when the default audio endpoint changes, call XUserUnregisterForDefaultAudioEndpointUtf16Changed. The following example demonstrates how to retrieve the default audio endpoint for a user.

Requirements

Header: XUser.h Library: xgameruntime.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

Conceptual documentation

See also

XUser XUserDefaultAudioEndpointUtf16ChangedCallback XUserRegisterForDefaultAudioEndpointUtf16Changed XUserUnregisterForDefaultAudioEndpointUtf16Changed
Last modified on August 20, 2026