-
Notifications
You must be signed in to change notification settings - Fork 228
Open
Description
According to this documentation and this starting a video call automatically start with speaker phone and when an external audio device is removed like a Bluetooth earphone then the SDK sets the audio route as follows (in order of priority): setEnableSpeakerphone > setDefaultAudioRouteToSpeakerphone > the default audio route but that doesn't really happen. After removing/disconnecting the Bluetooth earphone the audio moves to earpiece. This also happens in a Voice call even if you set setDefaultAudioRouteToSpeakerphone to true. We are using 3.7.0.
We also tried to update the route during audio route change but setEnableSpeakerphone and setDefaultAudioRoutetoSpeakerphone does not work.
@Override
public void onAudioRouteChanged(int routing) {
super.onAudioRouteChanged(routing);
switch (routing) {
case Constants.AUDIO_ROUTE_EARPIECE: //Next move: Speaker
speakerBtn.setAlpha(1f);
speakerBtn.setEnabled(true);
rtcEngine().setEnableSpeakerphone(false);
rtcEngine().setDefaultAudioRoutetoSpeakerphone(false);
speakerBtn.setImageResource(R.drawable.ic_speaker_on);
break;
case Constants.AUDIO_ROUTE_SPEAKERPHONE: //Next move Earpiece
speakerBtn.setAlpha(1f);
speakerBtn.setEnabled(true);
rtcEngine().setEnableSpeakerphone(true);
rtcEngine().setDefaultAudioRoutetoSpeakerphone(true);
speakerBtn.setImageResource(R.drawable.ic_speaker_off);
break;
default:
speakerBtn.setAlpha(0.3f);
speakerBtn.setEnabled(false); // More icon for Headset Bluetooth, Headset with mic, Headset without mic, External speaker
break;
// See https://docs.agora.io/en/All/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler.html#a61961c9f6681f1cd781527fed8fa649c
}
}
silversquall
Metadata
Metadata
Assignees
Labels
No labels