Open easyscripter opened 1 year ago
same issue for me I use Android 13
Same here. Is a Samsung device @edritech93?
Tested with Samsung and Oppo both Android 12 and it didn't work.
Neither setForceSpeakerphoneOn nor setSpeakerphoneOn is working. Looking at the logs, I see it update the defaultAudioMode but it didn't route the audio to the phone speaker.
setForceSpeakerphoneOn() flag: 1 updateAudioDeviceState: wired headset=false, BT state=HEADSET_UNAVAILABLE Device status: available=[EARPIECE, SPEAKER_PHONE], selected=SPEAKER_PHONE, user selected=SPEAKER_PHONE updateAudioDeviceState done
I'm calling the .start before trying to change the audio to the speaker.
If you are using RN-InCallManager in conjunction with RN-CallKeep, remember to call RNCallKeep.toggleAudioRouteSpeaker() after calling setForceSpeakerphoneOn(), for some reason the RNCallKeep has control if you have called the RNCallKeep.startCall() first.
hey @mariouzae, does this work for you 100% of the time?
For me audio switch worked after adding permission in AndroidManifest.xml file
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
When il make incoming call and accept . il try setSpeakerPhoneOn but its not working. But for outgoing call its working. I use sip js react-native webrtc and react native incall manager.
const onAccepted = (data: any) => { if (data && data.route === 'incoming') { setCallActive(true); setIsCalling(false); InCallManager.start({media: 'audio'}); RNCallKeep.setCurrentCallActive(currentCallUUID); } else if (data && data.route === 'outgoing') { RNCallKeep.setCurrentCallActive(currentCallUUID); setIsCalling(false); InCallManager.stopRingback(); } }
const handleSpeaker = (isSpeaker: boolean) => { InCallManager.setSpeakerphoneOn(isSpeaker); }