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

change speakers and microphones #2166

Closed
gaoruiqing187 opened this issue May 28, 2024 · 2 comments
Closed

change speakers and microphones #2166

gaoruiqing187 opened this issue May 28, 2024 · 2 comments

Comments

@gaoruiqing187
Copy link

Hi, I'm having some trouble switching between speakers and microphones. Below is my code, can be used before, suddenly found yesterday whether core. GetExtendedAudioDevices or core. GetAudioDevices can only be called a Unknown device. I also wrote the permission in the Manifest, please help solve it,thank you!
image

@gaoruiqing187 gaoruiqing187 changed the title 切换扬声器和麦克风 change speakers and microphones May 28, 2024
@Viish
Copy link
Member

Viish commented May 28, 2024

HI @gaoruiqing187,

Your way of checking capabilities is wrong.
Use device.hasCapability(AudioDevice.Capabilities.CapabilityPlay) instead of device.getCapabilities() == AudioDevice.Capabilities.CapabilityPlay)
For example : https://gitlab.linphone.org/BC/public/linphone-android/-/blob/master/app/src/main/java/org/linphone/utils/AudioRouteUtils.kt#L283

Cheers,

@Viish Viish closed this as completed May 28, 2024
@gaoruiqing187
Copy link
Author

gaoruiqing187 commented May 28, 2024

@Viish That's not my problem. My problem is that I don't have access to other inbound and outbound devices

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

No branches or pull requests

2 participants