AgoraIO-Extensions / react-native-agora

React Native around the Agora RTC SDKs for Android and iOS agora
https://www.agora.io
MIT License
622 stars 228 forks source link

Switch between airpods, speakerphone and earpiece. #401

Closed ricofegh closed 2 years ago

ricofegh commented 3 years ago

I'm developing a calling application for iOS. Seems Agora recognizes AirPods only if I set GameStreaming scenario.

engine.setAudioProfile(AudioProfile.Default, AudioScenario.GameStreaming)

I don't really understand why it works, because the official documentation regarding audio scenarios is confusing.

The problem here is that it affects the speakerphone volume somehow. If I route playback to the speakerphone while this scenario is activated, I almost cannot hear anything. With the default scenario, it is loud enough.

Could anybody explain how it works and how to make reliable switching between AirPods, speakerphone and earpiece during the call?

LichKing-2234 commented 2 years ago

https://docs.agora.io/en/Video/set_audio_route_ios?platform=iOS https://docs.agora.io/en/Interactive%20Broadcast/faq/system_volume

Are these docs helpful?

LichKing-2234 commented 2 years ago

I will close this issue, you can reopen it if still exists.