How can I get and convert the remote Audio stream data on Android? Preferably in the form of byte array buffers. I would then upload the data to some third party service to process.
I've seen something similar done on Web here and here with the help of MediaStream Recording API, where they used MediaRecorder
as the media to get the buffered data from MediaStream
into an array. How can I do something similar on Android?
I know that it's possible to obtain the local audio data by setting a listener that implements SamplesReadyCallback
in the setSamplesReadyCallback()
method when creating the local AudioDeviceModule
used for capturing local audio. This method doesn't really involve WebRTC's PeerConnection
, it's essentially just setting a callback listener on the local audio data. Worst case scenario, I can just retrieve the local audio data by this method and send them off to the remote side via DataChannel
, but I would still like a more ideal solution that can avoid sending essentially the same data twice.