> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XUserRegisterForDefaultAudioEndpointUtf16Changed

> XUserRegisterForDefaultAudioEndpointUtf16Changed

# XUserRegisterForDefaultAudioEndpointUtf16Changed

Registers a callback that the application defines and invokes when the default audio endpoint changes.

## Syntax

```cpp theme={null}
HRESULT XUserRegisterForDefaultAudioEndpointUtf16Changed(  
         XTaskQueueHandle queue,  
         void* context,  
         XUserDefaultAudioEndpointUtf16ChangedCallback* callback,  
         XTaskQueueRegistrationToken* token  
)  
```

### Parameters

*queue*   \_In\_opt\_\
Type: XTaskQueueHandle

A handle to the asynchronous queue to put the change callback on.

*context*   \_In\_opt\_\
Type: void\*

The context the application defines and passes to the callback.

*callback*   \_In\_\
Type: XUserDefaultAudioEndpointUtf16ChangedCallback\*

The callback the application defines and registers for audio endpoint change events.

*token*   \_Out\_\
Type: [XTaskQueueRegistrationToken\*](/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken)

On success, receives a token that identifies the callback. To un-register the callback, pass this token to the [XUserUnregisterForDefaultAudioEndpointUtf16Changed](/reference/system/xuser/functions/xuserunregisterfordefaultaudioendpointutf16changed) function.

### Return value

Type: HRESULT

HRESULT success or error code.\
For a list of error codes, see [Error Codes](/reference/errorcodes).

## Remarks

<Note>This function isn't safe to call on a time-sensitive thread. For more information, see [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).</Note>

To unregister a previously-registered default audio endpoint change callback, call [XUserUnregisterForDefaultAudioEndpointUtf16Changed](/reference/system/xuser/functions/xuserunregisterfordefaultaudioendpointutf16changed).

To register a user device association callback, call [XUserRegisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged).

To un-register a previously registered user device association change callback, call [XUserUnregisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserunregisterfordeviceassociationchanged).

## Requirements

**Header:** XUser.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## Conceptual documentation

* [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## See also

[XUser](/reference/system/xuser/xuser_members)\
[XUserDefaultAudioEndpointUtf16ChangedCallback](/reference/system/xuser/functions/xuserdefaultaudioendpointutf16changedcallback)\
[XUserUnregisterForDefaultAudioEndpointUtf16Changed](/reference/system/xuser/functions/xuserunregisterfordefaultaudioendpointutf16changed)


## Related topics

- [XUserDefaultAudioEndpointUtf16ChangedCallback](/reference/system/xuser/functions/xuserdefaultaudioendpointutf16changedcallback.md)
- [XUserUnregisterForDefaultAudioEndpointUtf16Changed](/reference/system/xuser/functions/xuserunregisterfordefaultaudioendpointutf16changed.md)
- [XUserGetDefaultAudioEndpointUtf16](/reference/system/xuser/functions/xusergetdefaultaudioendpointutf16.md)
- [XUserRegisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md)
- [XUserUnregisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserunregisterfordeviceassociationchanged.md)
