File tree Expand file tree Collapse file tree
app/src/main/java/com/upnp/fakeCall Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,7 +84,8 @@ class FakeConnection(
8484 override fun onCallAudioStateChanged (state : CallAudioState ) {
8585 super .onCallAudioStateChanged(state)
8686 runCatching {
87- audioManager.isMicrophoneMute = state.isMuted
87+ // Keep the mic live while we are actively recording to avoid unexpected dropouts.
88+ audioManager.isMicrophoneMute = if (mediaRecorder != null ) false else state.isMuted
8889 }
8990 }
9091
@@ -168,7 +169,8 @@ class FakeConnection(
168169 }
169170
170171 recorder.apply {
171- setAudioSource(MediaRecorder .AudioSource .VOICE_COMMUNICATION )
172+ // MIC is more stable for continuous capture during self-managed calls.
173+ setAudioSource(MediaRecorder .AudioSource .MIC )
172174 setOutputFormat(MediaRecorder .OutputFormat .MPEG_4 )
173175 setAudioEncoder(MediaRecorder .AudioEncoder .AAC )
174176 setAudioEncodingBitRate(256_000 )
You can’t perform that action at this time.
0 commit comments