Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Getting audio playback and capture devices are currently used in the OS by default #28

Closed
Stasyanych opened this issue Sep 16, 2021 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@Stasyanych
Copy link

Thank you for a very useful library! I would like to know how to get audio devices that are currently used in the OS by default and is it possible to do this in the current version of the library? Thank you in advance for your answer.

@Stasyanych Stasyanych added the enhancement New feature or request label Sep 16, 2021
@devopvoid
Copy link
Owner

I started to create wiki pages for this library. There is a wiki page for media devices. Right now, the Java API does not have methods implemented to retrieve the default device of the OS. BUT, the native code does have an implementation which works at least for Windows and macOS, Linux not tested with default devices.

Will add these methods to the Java implementation.

@Stasyanych
Copy link
Author

Thanks a lot for the quick response.

@polyn0m
Copy link

polyn0m commented Jan 17, 2022

@devopvoid 0.6 resolve this?

@devopvoid
Copy link
Owner

The version 0.6.0 should resolve this issue.

MediaDevices.getDefaultAudioRenderDevice(); (e.g. speaker)
MediaDevices.getDefaultAudioCaptureDevice(); (e.g. microphone)

Please let me know if this works for you.

@Stasyanych
Copy link
Author

It works for me. I'm tested this on Win10.
But on MacOS getDeafultAudioRenderDevice() return empty device name if used embedded speaker.

@Stasyanych
Copy link
Author

Hello, dear friend!
Thanks again for the great work done.
I continue to investigate the WebRTC library in more detail and found the following problems with getting a list of devices.
Problems concern macOS:

  1. The "deviceConnected" and "deviceDisconnected" method of the DeviceChange Listener interface returns an empty name if it has Cyrillic characters. The problem is clearly in the encoding
  2. The AudioDeviceModule method.getPlayoutDevices() returns the device names correctly, but the descriptor values are missing.
  3. The number of devices that mediaDevices and AudioDeviceModule returns is different.
    This leads to the fact that it is not always possible to correctly install the connected device in the DeviceChangeListener event
    I attach a screenshot that shows everything described above.

diff_devices

@polyn0m
Copy link

polyn0m commented Nov 7, 2022

Hello @devopvoid

This issue fix in next version?

@devopvoid
Copy link
Owner

I'm on it. Will test the mac version this week and comment on this issue.

devopvoid added a commit that referenced this issue Nov 13, 2022
@devopvoid
Copy link
Owner

The latest snapshot now works with Cyrillic and other characters.

@Stasyanych
Copy link
Author

Stasyanych commented Mar 14, 2023

Thanks for the fix for the Cyrillic problem. Please tell me, has anything been done with the fact that all capture devices and playout devices guid returned as null when received through AudioDeviceModule? This behavior is only on MacOS. On win10 everything is fine. In our correspondence above I attached a screenshot where you can see it.
Thank you in advance for the answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants