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

# XInputGetAudioDeviceIds

> XInputGetAudioDeviceIds

# XInputGetAudioDeviceIds

<Note>此函数尚未实现。</Note>

检索连接到指定控制器的耳机的音频呈现和捕获设备的 ID。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
DWORD XInputGetAudioDeviceIds( 
         DWORD dwUserIndex,​
         LPWSTR pRenderDeviceId,​
         UINT * pRenderCount,​
         LPWSTR pCaptureDeviceId,​
         UINT * pCaptureCount
)​ 
```

<a id="parametersSection" />

### 参数

*dwUserIndex*   \_In\_\
类型：DWORD

与该耳机关联的玩家的索引；取值范围为 0 到 `XUSER_MAX_COUNT - 1`。

*pRenderDeviceId*    \_Out\_writes\_opt\_z\_(\*pRenderCount)\
类型：LPWSTR

音频呈现设备的 ID；即播放音频输出的设备，例如耳机。

*pRenderCount*     \_Inout\_opt\_\
类型：UINT\*

呈现设备 ID 字符串缓冲区的大小，以宽字符为单位。

*pCaptureDeviceId*    \_Out\_writes\_opt\_z\_(\*pCaptureCount)\
类型：LPWSTR

音频捕获设备的 ID；即捕获音频输入的设备，例如麦克风。

*pCaptureCount*    \_Inout\_opt\_\
类型：UINT\*

捕获设备 ID 字符串缓冲区的大小，以宽字符为单位。

<a id="retvalSection" />

### 返回值

类型：DWORD

如果函数成功检索到呈现和捕获的设备 ID，则返回代码为 `ERROR_SUCCESS`。

如果没有耳机连接到控制器，函数也会返回 `ERROR_SUCCESS`，并且 *pRenderDeviceId* 和 *pCaptureDeviceId* 的值为 `NULL`。

如果控制器端口设备未物理连接，函数将返回 `ERROR_DEVICE_NOT_CONNECTED`。

如果函数失败，则返回 Win32 错误代码。

<a id="remarksSection" />

## 备注

调用方必须为传递给此函数的缓冲区分配内存。生成的字符串长度可能是任意的。

有关详细信息，请参见 [XInputOnGameInput 包装器](/build/core-features/common/input/porting/input-porting-xinput#xinputWrapperSection)。

<a id="requirementsSection" />

## 要求

**头文件：** XInputOnGameInput.h

**库：** xgameruntime.lib

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

<a id="seealsoSection" />

## 另请参阅

[从 XInput 迁移到 GameInput](/build/core-features/common/input/porting/input-porting-xinput)\
[XInputOnGameInput](/reference/input/xinputongameinput/xinputongameinput_members)


## Related topics

- [XInputOnGameInput](/zh-CN/reference/input/xinputongameinput/xinputongameinput_members.md)
- [PartyLocalChatControl::GetAudioInput](/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyLocalChatControl/methods/partylocalchatcontrol_getaudioinput.md)
- [GameInputDeviceStatus](/zh-CN/reference/input/gameinput/enums/gameinputdevicestatus.md)
- [XInputGetDeviceId](/zh-CN/reference/input/xinputongameinput/functions/xinputgetdeviceid.md)
- [GameInputDeviceCapabilities](/zh-CN/reference/input/gameinput/deprecated/enums/gameinputdevicecapabilities.md)
