io.agora.rtc

## Interface IAudioFrameObserver

- All Known Implementing Classes:
    AgoraAudioFrameObserver, DefaultAudioFrameObserver

      public interface IAudioFrameObserver

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getObservedAudioFramePosition()`
    `int` | `onEarMonitoringAudioFrame(AgoraLocalUser agoraLocalUser, AudioFrame frame)` Note: To improve data transmission efficiency, the buffer of the frame object is a DirectByteBuffer.
    `int` | `onMixedAudioFrame(AgoraLocalUser agoraLocalUser, java.lang.String channelId, AudioFrame frame)` Note: To improve data transmission efficiency, the buffer of the frame object is a DirectByteBuffer.
    `int` | `onPlaybackAudioFrame(AgoraLocalUser agoraLocalUser, java.lang.String channelId, AudioFrame frame)` Note: To improve data transmission efficiency, the buffer of the frame object is a DirectByteBuffer.
    `int` | `onPlaybackAudioFrameBeforeMixing(AgoraLocalUser agoraLocalUser, java.lang.String channelId, java.lang.String userId, AudioFrame frame, VadProcessResult vadResult)` Note: To improve data transmission efficiency, the buffer of the frame object is a DirectByteBuffer.
    `int` | `onRecordAudioFrame(AgoraLocalUser agoraLocalUser, java.lang.String channelId, AudioFrame frame)` Note: To improve data transmission efficiency, the buffer of the frame object is a DirectByteBuffer.

- - ### Method Detail

    - #### onRecordAudioFrame

          int onRecordAudioFrame(AgoraLocalUser agoraLocalUser,
                                 java.lang.String channelId,
                                 AudioFrame frame)

      Note: To improve data transmission efficiency, the buffer of the frame object is a DirectByteBuffer. Be sure to extract the byte array value in the callback synchronously and then transfer it to the asynchronous thread for processing. You can refer to `Utils.getBytes(ByteBuffer)`.
      Parameters:
        `agoraLocalUser` - the local user
        `channelId` - the channel id
        `frame` - the audio frame
      Returns:
        0/1, the return value currently has no practical significance

    - #### onPlaybackAudioFrame

          int onPlaybackAudioFrame(AgoraLocalUser agoraLocalUser,
                                   java.lang.String channelId,
                                   AudioFrame frame)

      Note: To improve data transmission efficiency, the buffer of the frame object is a DirectByteBuffer. Be sure to extract the byte array value in the callback synchronously and then transfer it to the asynchronous thread for processing. You can refer to `Utils.getBytes(ByteBuffer)`.
      Parameters:
        `agoraLocalUser` - the local user
        `channelId` - the channel id
        `frame` - the audio frame
      Returns:
        0/1, the return value currently has no practical significance

    - #### onMixedAudioFrame

          int onMixedAudioFrame(AgoraLocalUser agoraLocalUser,
                                java.lang.String channelId,
                                AudioFrame frame)

      Note: To improve data transmission efficiency, the buffer of the frame object is a DirectByteBuffer. Be sure to extract the byte array value in the callback synchronously and then transfer it to the asynchronous thread for processing. You can refer to `Utils.getBytes(ByteBuffer)`.
      Parameters:
        `agoraLocalUser` - the local user
        `channelId` - the channel id
        `frame` - the audio frame
      Returns:
        0/1, the return value currently has no practical significance

    - #### onEarMonitoringAudioFrame

          int onEarMonitoringAudioFrame(AgoraLocalUser agoraLocalUser,
                                        AudioFrame frame)

      Note: To improve data transmission efficiency, the buffer of the frame object is a DirectByteBuffer. Be sure to extract the byte array value in the callback synchronously and then transfer it to the asynchronous thread for processing. You can refer to `Utils.getBytes(ByteBuffer)`.
      Parameters:
        `agoraLocalUser` - the local user
        `frame` - the audio frame
      Returns:
        0/1, the return value currently has no practical significance

    - #### onPlaybackAudioFrameBeforeMixing

          int onPlaybackAudioFrameBeforeMixing(AgoraLocalUser agoraLocalUser,
                                               java.lang.String channelId,
                                               java.lang.String userId,
                                               AudioFrame frame,
                                               VadProcessResult vadResult)

      Note: To improve data transmission efficiency, the buffer of the frame object is a DirectByteBuffer. Be sure to extract the byte array value in the callback synchronously and then transfer it to the asynchronous thread for processing. You can refer to `Utils.getBytes(ByteBuffer)`.
      Parameters:
        `agoraLocalUser` - the local user
        `channelId` - the channel id
        `userId` - the user id
        `frame` - the audio frame
        `vadResult` - the vad result
      Returns:
        0/1, the return value currently has no practical significance

    - #### getObservedAudioFramePosition

          int getObservedAudioFramePosition()