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

擷取連接至指定控制器之耳機的音訊轉譯和擷取裝置識別碼。

<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

音訊轉譯裝置的識別碼；也就是播放音訊輸出的裝置，例如耳機。

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

轉譯裝置識別碼之字串緩衝區的大小 (以寬字元為單位)。

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

音訊擷取裝置的識別碼；也就是擷取音訊輸入的裝置，例如麥克風。

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

擷取裝置識別碼之字串緩衝區的大小 (以寬字元為單位)。

<a id="retvalSection" />

### 傳回值

類型：DWORD

如果函式成功擷取轉譯和擷取的裝置識別碼，傳回碼為 `ERROR_SUCCESS`。

如果沒有耳機連接至控制器，函式也會傳回 `ERROR_SUCCESS`，且 *pRenderDeviceId* 和 *pCaptureDeviceId* 的值為 `NULL`。

如果控制器連接埠裝置未實際連接，函式會傳回 `ERROR_DEVICE_NOT_CONNECTED`。

如果函式失敗，會傳回 Win32 錯誤碼。

<a id="remarksSection" />

## 備註

呼叫端必須為傳遞給此函式的緩衝區配置記憶體。產生的字串可以是任意長度。

如需詳細資訊，請參閱 [XInputOnGameInput 包裝函式](/zh-TW/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](/zh-TW/build/core-features/common/input/porting/input-porting-xinput)\
[XInputOnGameInput](/zh-TW/reference/input/xinputongameinput/xinputongameinput_members)


## Related topics

- [XInputGetAudioDeviceIds](/reference/input/xinputongameinput/functions/xinputgetaudiodeviceids.md)
- [XInputOnGameInput](/reference/input/xinputongameinput/xinputongameinput_members.md)
