Use microphone in webrtc & media recorder simultaneously in Android?
Asked Answered
F

1

1

I am using webrtc for video calling in android. I am simultaneously screen recording after call is connected in sender end. I am getting this error log in sender end. Receiver end voice is not hearing when screen recording is started using MediaRecorder. I think webrtc is not streaming audio to receiver end when media recorder is started using microphone.

Error

AudioRecord: start() status -38
2020-06-25 13:37:18.948 3276-5257/com.obs.booking E/WebRtcAudioRecord: WebRtcAudioRecord: Start recording error: AUDIO_RECORD_START_STATE_MISMATCH. AudioRecord.startRecording failed - incorrect state :1
2020-06-25 13:37:18.949 3276-5257/com.obs.booking E/AudioRecordJni: StartRecording failed!
2020-06-25 13:37:18.949 3276-5257/com.obs.booking E/libjingle: (voe_base_impl.cc:439): StartSend: Failed to start recording
2020-06-25 13:37:18.949 3276-5257/com.obs.booking E/libjingle: (voe_base_impl.cc:386): StartSend() failed to start recording
2020-06-25 13:37:18.949 3276-5257/com.obs.booking E/libjingle: (audio_send_stream.cc:245): AudioSendStream::Start failed with error: -1

Help me out to resolve this error.

Fionafionna answered 29/6, 2020 at 8:16 Comment(0)
S
0

The error message indicates that the audio recording is failed due to incorrect state. This error "AUDIO_RECORD_START_STATE_MISMATCH" tells that when the start() methods is called the audio recording already is in progress. It is possible there is a conflict between media-recording and WEBRTC audio recording.

To solve this there are several ways that I hope be useful:

1 - make sure the source of both are same.

2 - Try to stop webRTC before start the media-recorder

Safekeeping answered 16/2, 2023 at 5:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.