How can I record WebRTC audio from Android?

1,224 views
Skip to first unread message

archie

unread,
Dec 3, 2019, 2:42:19 AM12/3/19
to discuss-webrtc
I'm trying to record audio of WebRTC video call. I tried to use an instance of the RecorderAudioToFileController.java(https://webrtc.googlesource.com/src/+/master/examples/androidapp/src/org/appspot/apprtc/RecordedAudioToFileController.java). It doesn't work because onWebRtcAudioRecordSamplesReady event does not trigger. Is there any way I can workaround this?

WebRTC is a great project but sadly it lacks documentation, especially for Android.

Henrik Andreasson

unread,
Dec 3, 2019, 4:12:04 AM12/3/19
to discuss-webrtc
See the AppRTCMobile as an example.

On Tue, Dec 3, 2019 at 8:42 AM archie <27.g...@gmail.com> wrote:
I'm trying to record audio of WebRTC video call. I tried to use an instance of the RecorderAudioToFileController.java(https://webrtc.googlesource.com/src/+/master/examples/androidapp/src/org/appspot/apprtc/RecordedAudioToFileController.java). It doesn't work because onWebRtcAudioRecordSamplesReady event does not trigger. Is there any way I can workaround this?

WebRTC is a great project but sadly it lacks documentation, especially for Android.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/35436b3d-e8cd-4d16-89ec-541f46ae1a1a%40googlegroups.com.

archie

unread,
Dec 23, 2019, 5:19:50 PM12/23/19
to discuss-webrtc
Thank you @Henrik.

Local audio recording works but the sound is a little bit distorted. Any reason why this is happening?

On Tuesday, December 3, 2019 at 11:12:04 AM UTC+2, Henrik Andreasson wrote:
See the AppRTCMobile as an example.

On Tue, Dec 3, 2019 at 8:42 AM archie <27....@gmail.com> wrote:
I'm trying to record audio of WebRTC video call. I tried to use an instance of the RecorderAudioToFileController.java(https://webrtc.googlesource.com/src/+/master/examples/androidapp/src/org/appspot/apprtc/RecordedAudioToFileController.java). It doesn't work because onWebRtcAudioRecordSamplesReady event does not trigger. Is there any way I can workaround this?

WebRTC is a great project but sadly it lacks documentation, especially for Android.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss...@googlegroups.com.

Henrik Andreasson

unread,
Jan 7, 2020, 4:03:06 AM1/7/20
to discuss-webrtc
Not sure but you might get a better result if you store the samples in memory instead and only write to a file when the call is ready.
You can also avoid the extra copy of audio data by injecting your own ADM (i.e., don't enable onWebRtcAudioRecordSamplesReady) and store the recorded audio samples in each audio callback.
The implementation in AppRTCMobile is mainly intended for testing and is not optimized for performance.

To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/c9c31d35-d229-4eee-8e9c-942201f33a4e%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages