opentok / opentok-windows-sdk-samples

Sample applications illustrating best practices using OpenTok Windows SDK
MIT License
9 stars 29 forks source link

Unable to query input and output devices on 2.25.x+ #61

Closed Cereal-Killa closed 10 months ago

Cereal-Killa commented 11 months ago

Describe the bug Up to version 2.24.2 getting input and output devices works no problem, 2.25.0 onwards returns an empty array.

To Reproduce Create a WPF app and run the following code: var Devices = OpenTok.AudioDevice.EnumerateInputAudioDevices();

Expected behavior Get an array of the input audio devices in the system.

Screenshots 2.25.0 and higher: image

2.24.2 and lower: image

Device (please compete the following information):

Additional context When building the app as x64 the app runs without any exception, but won't list the devices unless I downgrade to 2.24.2. Running the app as x86 or "Any Cpu" throws "An attempt was made to load a program with an incorrect format". (unrelated but are there dlls for those binaries?)

sergioturgil-vonage commented 11 months ago

Hi, the problem is real and the fix is coming in 2.26.1

To clarify, the origin of the problem is a change in the implementation where we started using the internal webrtc audio module to enumerate devices instead of a platform specific way. This adds the requirement for webrtc to be initialized before enumerating, which generally happens when you create the first publisher. This also means that moving enumeration after publisher creation would also fix the problem if waiting for 2.26.1 is not an option.

We had to make this change as part of an effort to make the SDK compatible with platforms that might not have that platform specific implementation of audio device enumeration.

beHaze commented 10 months ago

Update released on 10/05. Please update to the latest, this should fix the issue.