question

Arthur Firmino avatar image
Arthur Firmino asked

Audio device identifier format on Windows platform

The documentation for PartyLocalChatControl::SetAudioInput (as well as SetAudioOutput) states that when using Manual selection then the audioDeviceSelectionContext parameter must be the non-null, non-empty identifier of the audio device.

In the absence of any PlayFab functions to enumerate audio devices I'm guessing I would have to use something like IMMDeviceEnumerator::EnumAudioEndpoints to retrieve the devices' Endpoint ID Strings and use one as the audioDeviceSelectionContext parameter.

The problem I see with this is is that the Endpoint ID String is a wide-character string, while audioDeviceSelectionContext is a PartyString (which is not wide-character). Of course I could convert it, but I'd like to have some confirmation first that this is what is expected on the Windows platform.

Also the documentation says to treat the Endpoint ID String as opaque so I have no reason to assume this would work.

apis
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

Party accepts a narrow(UTF8) string, you can convert the wide string returned from IMMDevice::Get to UTF8 with something like WideCharToMultibyte. And, on Windows 10, Party also accepts a Windows.Media.Device identifier, here is table on the following page detailing what identifier formats are accepted: Understanding How PlayFab Party chat works - PlayFab | Microsoft Docs

In addition, it's strongly recommended that you use PartyAudioDeviceSelectionType::SystemDefault on Windows as that'll tell Party to automatically choose the audio device configured as the default communications device, without the hassle of specifying it by yourself.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.