Class WebRtcAudioTrack

java.lang.Object
org.webrtc.audio.WebRtcAudioTrack

public class WebRtcAudioTrack extends Object
  • Field Details

    • TAG

      private static final String TAG
      See Also:
    • BITS_PER_SAMPLE

      private static final int BITS_PER_SAMPLE
      See Also:
    • CALLBACK_BUFFER_SIZE_MS

      private static final int CALLBACK_BUFFER_SIZE_MS
      See Also:
    • BUFFERS_PER_SECOND

      private static final int BUFFERS_PER_SECOND
      See Also:
    • AUDIO_TRACK_THREAD_JOIN_TIMEOUT_MS

      private static final long AUDIO_TRACK_THREAD_JOIN_TIMEOUT_MS
      See Also:
    • DEFAULT_USAGE

      private static final int DEFAULT_USAGE
      See Also:
    • AUDIO_TRACK_START

      private static final int AUDIO_TRACK_START
      See Also:
    • AUDIO_TRACK_STOP

      private static final int AUDIO_TRACK_STOP
      See Also:
    • nativeAudioTrack

      private long nativeAudioTrack
    • threadChecker

      private final ThreadUtils.ThreadChecker threadChecker
    • byteBuffer

      private ByteBuffer byteBuffer
    • audioAttributes

      @Nullable private final Object audioAttributes
    • speakerMute

      private volatile boolean speakerMute
    • emptyBytes

      private byte[] emptyBytes
    • useLowLatency

      private boolean useLowLatency
    • initialBufferSizeInFrames

      private int initialBufferSizeInFrames
    • errorCallback

      @Nullable private final JavaAudioDeviceModule.AudioTrackErrorCallback errorCallback
    • stateCallback

      @Nullable private final JavaAudioDeviceModule.AudioTrackStateCallback stateCallback
    • readSizeInBytes

      private int readSizeInBytes
    • sampleRate

      private int sampleRate
    • bytesPerSample

      private int bytesPerSample
    • channels

      private int channels
    • audioTrackListener

      private IAudioTrackListener audioTrackListener
  • Constructor Details

  • Method Details

    • getPlayoutData

      public ByteBuffer getPlayoutData()
    • getReadSizeInBytes

      public int getReadSizeInBytes()
    • setNativeAudioTrack

      public void setNativeAudioTrack(long nativeAudioTrack)
    • initPlayout

      private int initPlayout(int sampleRate, int channels, double bufferSizeFactor)
    • startPlayout

      private boolean startPlayout()
    • getBytesPerSample

      public int getBytesPerSample()
    • stopPlayout

      private boolean stopPlayout()
    • getStreamMaxVolume

      private int getStreamMaxVolume()
    • setStreamVolume

      private boolean setStreamVolume(int volume)
    • getStreamVolume

      private int getStreamVolume()
      Get current volume level for a phone call audio stream.
    • GetPlayoutUnderrunCount

      private int GetPlayoutUnderrunCount()
    • logNativeOutputSampleRate

      private static void logNativeOutputSampleRate(int requestedSampleRateInHz)
    • getBufferSizeInFrames

      private int getBufferSizeInFrames()
    • getInitialBufferSizeInFrames

      private int getInitialBufferSizeInFrames()
    • logBufferCapacityInFrames

      private void logBufferCapacityInFrames()
    • assertTrue

      private static void assertTrue(boolean condition)
    • nativeCacheDirectBufferAddress

      private static void nativeCacheDirectBufferAddress(long nativeAudioTrackJni, ByteBuffer byteBuffer)
    • nativeGetPlayoutData

      private static void nativeGetPlayoutData(long nativeAudioTrackJni, int bytes)
    • setSpeakerMute

      public void setSpeakerMute(boolean mute)
    • reportWebRtcAudioTrackInitError

      private void reportWebRtcAudioTrackInitError(String errorMessage)
    • reportWebRtcAudioTrackStartError

      private void reportWebRtcAudioTrackStartError(JavaAudioDeviceModule.AudioTrackStartErrorCode errorCode, String errorMessage)
    • reportWebRtcAudioTrackError

      private void reportWebRtcAudioTrackError(String errorMessage)
    • doAudioTrackStateCallback

      private void doAudioTrackStateCallback(int audioState)
    • getSampleRate

      public int getSampleRate()
    • getChannels

      public int getChannels()