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

# XUserRegisterForDefaultAudioEndpointUtf16Changed

> XUserRegisterForDefaultAudioEndpointUtf16Changed

# XUserRegisterForDefaultAudioEndpointUtf16Changed

注册应用程序定义并在默认音频终结点更改时调用的回调。

## 语法

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

### 参数

*queue*   \_In\_opt\_\
类型：XTaskQueueHandle

要在其上放置更改回调的异步队列的句柄。

*context*   \_In\_opt\_\
类型：void\*

应用程序定义并传递给回调的上下文。

*callback*   \_In\_\
类型：XUserDefaultAudioEndpointUtf16ChangedCallback\*

应用程序定义并为音频终结点更改事件注册的回调。

*token*   \_Out\_\
类型：[XTaskQueueRegistrationToken\*](https://docs.xbox.com/zh-CN/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)

成功时，接收标识该回调的令牌。若要取消注册该回调，请将此令牌传递给 [XUserUnregisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserunregisterfordefaultaudioendpointutf16changed.md) 函数。

### 返回值

类型：HRESULT

HRESULT 成功或错误代码。\
有关错误代码列表，请参阅[错误代码](https://docs.xbox.com/zh-CN/reference/errorcodes.md)。

## 注解

> [!NOTE]
>
> 在时间敏感线程上调用此函数并不安全。有关详细信息，请参阅[时间敏感线程](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)。

若要取消注册先前注册的默认音频终结点更改回调，请调用 [XUserUnregisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserunregisterfordefaultaudioendpointutf16changed.md)。

若要注册用户设备关联回调，请调用 [XUserRegisterForDeviceAssociationChanged](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md)。

若要取消注册先前注册的用户设备关联更改回调，请调用 [XUserUnregisterForDeviceAssociationChanged](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserunregisterfordeviceassociationchanged.md)。

## 要求

**头文件：** XUser.h

**库：** xgameruntime.lib

**支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

## 概念文档

* [时间敏感线程](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## 另请参阅

\u0001\u0001\u0001
[XUser](https://docs.xbox.com/zh-CN/reference/system/xuser/xuser_members.md)\
[XUserDefaultAudioEndpointUtf16ChangedCallback](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserdefaultaudioendpointutf16changedcallback.md)\
[XUserUnregisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserunregisterfordefaultaudioendpointutf16changed.md)


## Related topics

- [XUserDefaultAudioEndpointUtf16ChangedCallback](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserdefaultaudioendpointutf16changedcallback.md)
- [XUserUnregisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserunregisterfordefaultaudioendpointutf16changed.md)
- [XUserGetDefaultAudioEndpointUtf16](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xusergetdefaultaudioendpointutf16.md)
- [XUserRegisterForDeviceAssociationChanged](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md)
- [XUserUnregisterForDeviceAssociationChanged](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserunregisterfordeviceassociationchanged.md)
