'Get WebRtc AudioTrack from pointer

Is there any way that I can do to get audioTrack from this pointer ?

I want to get real stream with ByteBuffer or something similar without forking webrtc

package org.webrtc;
public class AudioTrack extends MediaStreamTrack {
  /** Returns a pointer to webrtc::AudioTrackInterface. */
  long getNativeAudioTrack() {
    return getNativeMediaStreamTrack();
  }
}


Solution 1:[1]

Try this

if(Stream_object.audioTracks.size() > 0){
    Stream_object.audioTracks.get(0);
    audioTrack.setEnabled(true);
}

Solution 2:[2]

If you are looking for audio byte buffers that are captured by webrtc from the microphone, then implement SamplesReadyCallback callback in JavaAudioDeviceModule. AudioSamples has the byte buffer data that is captured by webrtc

public static interface SamplesReadyCallback {
    void onWebRtcAudioRecordSamplesReady(AudioSamples samples);
  }

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 sourabh karmakar
Solution 2 Pratim