> ## 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.

# XUserDefaultAudioEndpointKind

> XUserDefaultAudioEndpointKind

# XUserDefaultAudioEndpointKind

사용자의 기본 오디오 엔드포인트가 오디오를 렌더링하는지 또는 캡처하는지 지정합니다.

## 구문

```cpp theme={null}
enum class XUserDefaultAudioEndpointKind  : uint32_t  
{  
    CommunicationRender = 0,  
    CommunicationCapture = 1  
}  
```

## 상수

| 상수                   | 설명                              |
| -------------------- | ------------------------------- |
| CommunicationRender  | 사용자의 기본 오디오 엔드포인트가 오디오를 렌더링합니다. |
| CommunicationCapture | 사용자의 기본 오디오 엔드포인트가 오디오를 캡처합니다.  |

## 설명

[XUserGetDefaultAudioEndpointUtf16](/reference/system/xuser/functions/xusergetdefaultaudioendpointutf16) 함수는 사용자의 기본 오디오 엔드포인트를 가져오기 위해 XUserDefaultAudioEndpointKind 열거형 인수를 사용합니다.
[XUserDefaultAudioEndpointUtf16ChangedCallback](/reference/system/xuser/functions/xuserdefaultaudioendpointutf16changedcallback) 함수는 XUserDefaultAudioEndpointKind 열거형 인수를 받으며, 사용자의 기본 오디오 엔드포인트가 변경될 때 호출됩니다.

다음 예제는 사용자의 기본 오디오 엔드포인트를 가져오는 방법을 보여줍니다.

```cpp theme={null}
HRESULT GetAudioDeviceAssociation(
    IMMDeviceEnumerator* audioDeviceEnumerator,
    XUserLocalId user,
    XUserDefaultAudioEndpointKind defaultAudioEndpointKind,
    _Outptr_result_maybenull_ IMMDevice** endpoint)
{
    wchar_t audioDeviceId[XUserAudioEndpointMaxUtf16Count];
    RETURN_IF_FAILED_WITH_EXPECTED(XUserGetDefaultAudioEndpointUtf16(user, defaultAudioEndpointKind, std::size(audioDeviceId), audioDeviceId, nullptr), E_NOTFOUND);

    return audioDeviceEnumerator->GetDevice(audioDeviceId, endpoint);
}

HRESULT GetAudioAssociations()
{
    Mwrl::ComPtr<IMMDeviceEnumerator> audioDeviceEnumerator;

    RETURN_IF_FAILED(CoCreateInstance(
        __uuidof(MMDeviceEnumerator),
        nullptr,
        CLSCTX_ALL,
        __uuidof(IMMDeviceEnumerator),
        (void**)&audioDeviceEnumerator));

    XUserLocalId userLocalId;
    RETURN_IF_FAILED(XUserGetLocalId(_handle.get(), &userLocalId));

    {
        wil::unique_cotaskmem_string id;
        Mwrl::ComPtr<IMMDevice> device;
        if (SUCCEEDED(GetAudioDeviceAssociation(audioDeviceEnumerator.Get(), userLocalId, XUserDefaultAudioEndpointKind::CommunicationRender, &device)))
        {
            RETURN_IF_FAILED(device->GetId(&id));
        }
        appLog.AddLog("Preferred render communication device id: %S\n", id.get());
    }

    {
        wil::unique_cotaskmem_string id;
        Mwrl::ComPtr<IMMDevice> device;
        if (SUCCEEDED(GetAudioDeviceAssociation(audioDeviceEnumerator.Get(), userLocalId, XUserDefaultAudioEndpointKind::CommunicationCapture, &device)))
        {
            RETURN_IF_FAILED(device->GetId(&id));
        }
        appLog.AddLog("Preferred capture communication device id: %S\n", id.get());
    }

    return S_OK;
}
```

## 요구 사항

**헤더:** XUser.h

**지원되는 플랫폼:** Windows, XBOX One 계열 콘솔 및 XBOX Series 콘솔

## 함께 보기

[XUser](/reference/system/xuser/xuser_members)

[XUserGetDefaultAudioEndpointUtf16](/reference/system/xuser/functions/xusergetdefaultaudioendpointutf16)

[XUserDefaultAudioEndpointUtf16ChangedCallback](/reference/system/xuser/functions/xuserdefaultaudioendpointutf16changedcallback)


## Related topics

- [XUserDefaultAudioEndpointUtf16ChangedCallback](/ko/reference/system/xuser/functions/xuserdefaultaudioendpointutf16changedcallback.md)
- [XUserGetDefaultAudioEndpointUtf16](/ko/reference/system/xuser/functions/xusergetdefaultaudioendpointutf16.md)
- [XUser](/ko/reference/system/xuser/xuser_members.md)
- [XUserRegisterForDefaultAudioEndpointUtf16Changed](/ko/reference/system/xuser/functions/xuserregisterfordefaultaudioendpointutf16changed.md)
- [XUserUnregisterForDefaultAudioEndpointUtf16Changed](/ko/reference/system/xuser/functions/xuserunregisterfordefaultaudioendpointutf16changed.md)
