XInputGetAudioDeviceIds
Hi all,
I've converted this code to VB.net and it works fine:
https://www.codeproject.com/Articles/492473/Using-XInput-to-access-an-Xbox-360-Controller-in-M
But XInputGetAudioDeviceIds is missing from it:
On the above page:
Getting Audio Device Identifiers
The headset for a controller has these functions:
Record sound using a microphone
Play back sound using a headphone
Use this code to obtain the device identifiers for the headset...
It's C++, no C# or VB.net sample, and nowhere can be found.
I use XboxController.RetrieveController(0/1/2/3) to select a controller but need to play a sample audio into the headset connected to the selected controller!
Anyone can help please?
Thanks in advance.
- Update: I've found these 2, but not sure which one to use, they're different in data types and byval/byref, and anyway, how to use it finally:
<DllImport("xinput1_4.dll")>
Public Function XInputGetAudioDeviceIds(ByVal dwUserIndex As Integer, ByVal pRenderDeviceId As IntPtr, ByVal pRenderCount As IntPtr, ByVal pCaptureDeviceId As IntPtr, ByVal pCaptureCount As IntPtr) As Integer
End Function
vs
<DllImport("xinput1_4.dll", SetLastError:=True)>
Public Function XInputGetAudioDeviceIds(ByVal dwUserIndex As UInteger, ByVal pRenderDeviceId As StringBuilder, ByRef pRenderCount As UInteger, ByVal pCaptureDeviceId As StringBuilder, ByRef pCaptureCount As UInteger) As UInteger
End Function