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

# XInputGetAudioDeviceIds

> XInputGetAudioDeviceIds

# XInputGetAudioDeviceIds

> [!NOTE]
>
> この関数はまだ実装されていません。

指定されたコントローラーに接続されているヘッドセットのオーディオ レンダリング デバイスとキャプチャ デバイスの ID を取得します。

## 構文

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

### パラメーター

*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 の文字列バッファーのサイズ (ワイド文字単位)。

### 戻り値

型: DWORD

関数がレンダリングとキャプチャのデバイス ID の取得に成功した場合、戻り値のコードは `ERROR_SUCCESS` です。

コントローラーにヘッドセットが接続されていない場合も、関数は *pRenderDeviceId* と *pCaptureDeviceId* の値を `NULL` として `ERROR_SUCCESS` を返します。

コントローラー ポートのデバイスが物理的に接続されていない場合、関数は `ERROR_DEVICE_NOT_CONNECTED` を返します。

関数が失敗した場合は、Win32 エラー コードを返します。

## 解説

呼び出し元は、この関数に渡すバッファーのメモリを割り当てる必要があります。結果として得られる文字列は任意の長さになる可能性があります。

詳細については、[XInputOnGameInput ラッパー](https://docs.xbox.com/ja-jp/build/core-features/common/input/porting/input-porting-xinput.md#xinputWrapperSection)を参照してください。

## 要件

**ヘッダー:** XInputOnGameInput.h

**ライブラリ:** xgameruntime.lib

**対応プラットフォーム:** XBOX One ファミリー本体および XBOX Series 本体

## 関連項目

[XInput から GameInput への移植](https://docs.xbox.com/ja-jp/build/core-features/common/input/porting/input-porting-xinput.md)\
[XInputOnGameInput](https://docs.xbox.com/ja-jp/reference/input/xinputongameinput/xinputongameinput_members.md)


## Related topics

- [XInputOnGameInput (API の内容)](https://docs.xbox.com/ja-jp/reference/input/xinputongameinput/xinputongameinput_members.md)
- [PartyLocalChatControl::GetAudioInput](https://docs.xbox.com/ja-jp/services/playfab/multiplayer/networking/reference/classes/PartyLocalChatControl/methods/partylocalchatcontrol_getaudioinput.md)
- [GameInputDeviceStatus](https://docs.xbox.com/ja-jp/reference/input/gameinput/enums/gameinputdevicestatus.md)
- [PartyLocalChatControl::SetAudioInput](https://docs.xbox.com/ja-jp/services/playfab/multiplayer/networking/reference/classes/PartyLocalChatControl/methods/partylocalchatcontrol_setaudioinput.md)
- [PartyAudioDeviceSelectionType](https://docs.xbox.com/ja-jp/services/playfab/multiplayer/networking/reference/enums/partyaudiodeviceselectiontype.md)
