Class IZegoCustomAudioProcessHandler


  • public abstract class IZegoCustomAudioProcessHandler
    extends java.lang.Object
    • Constructor Detail

      • IZegoCustomAudioProcessHandler

        public IZegoCustomAudioProcessHandler()
    • Method Detail

      • onProcessCapturedAudioData

        public void onProcessCapturedAudioData​(java.nio.ByteBuffer data,
                                               int dataLength,
                                               ZegoAudioFrameParam param,
                                               double timestamp)
        Custom audio processing local captured PCM audio frame callback. Available: Since 2.13.0 Description: In this callback, you can receive the PCM audio frames captured locally after used headphone monitor. Developers can modify the audio frame data, as well as the audio channels and sample rate. The timestamp can be used for data synchronization, such as lyrics, etc. If you need the data after used headphone monitor, please use the [onProcessCapturedAudioDataAfterUsedHeadphoneMonitor] callback. When to trigger: You need to call [enableCustomAudioCaptureProcessing] to enable the function first, and call [startPreivew] or [startPublishingStream] to trigger this callback function. Restrictions: None. Caution: This callback is a high-frequency callback, please do not perform time-consuming operations in this callback.
        Parameters:
        data - Audio data in PCM format.
        dataLength - Length of the data.
        param - Parameters of the audio frame.
        timestamp - The audio frame timestamp, starting from 0 when capture is started, the unit is milliseconds.
      • onProcessCapturedAudioDataAfterUsedHeadphoneMonitor

        public void onProcessCapturedAudioDataAfterUsedHeadphoneMonitor​(java.nio.ByteBuffer data,
                                                                        int dataLength,
                                                                        ZegoAudioFrameParam param,
                                                                        double timestamp)
        Custom audio processing local captured PCM audio frame callback after used headphone monitor. Available: Since 2.13.0 Description: In this callback, you can receive the PCM audio frames captured locally after used headphone monitor. Developers can modify the audio frame data, as well as the audio channels and sample rate. The timestamp can be used for data synchronization, such as lyrics, etc. When to trigger: You need to call [enableCustomAudioCaptureProcessingAfterHeadphoneMonitor] to enable the function first, and call [startPreivew] or [startPublishingStream] to trigger this callback function. Caution: This callback is a high-frequency callback, please do not perform time-consuming operations in this callback.
        Parameters:
        data - Audio data in PCM format
        dataLength - Length of the data
        param - Parameters of the audio frame
        timestamp - The audio frame timestamp, starting from 0 when capture is started, the unit is milliseconds.
      • onAlignedAudioAuxData

        public void onAlignedAudioAuxData​(java.nio.ByteBuffer data,
                                          int dataLength,
                                          ZegoAudioFrameParam param)
        Aligned audio aux frames callback. Available: Since 2.22.0 Description: In this callback, you can receive the audio aux frames which aligned with accompany. Developers can record locally. When to trigger: This callback function will not be triggered until [enableAlignedAudioAuxData] is called to turn on the function and [startpublishingstream] or [startrecordingcaptureddata] is called. Restrictions: To obtain audio aux data of the media player from this callback, developers need to call [enableAux] and [start] of MediaPlayer. Caution: This callback is a high-frequency callback, please do not perform time-consuming operations in this callback, and the data in this callback cannot be modified.
        Parameters:
        data - Audio data in PCM format.
        dataLength - Length of the data.
        param - Parameters of the audio frame.
      • onBeforeAudioPrepAudioData

        public void onBeforeAudioPrepAudioData​(java.nio.ByteBuffer data,
                                               int dataLength,
                                               ZegoAudioFrameParam param)
        Audio data callback before SDK internal audio preprocessing. Available: Since 3.11.0 Description: In this callback, you can receive the audio data before SDK internal audio preprocessing. When to trigger: This callback function will not be triggered until [enableBeforeAudioPrepAudioData] is called to turn on the function and [startpublishingstream] is called. Restrictions: None. Caution: This callback is a high-frequency callback, please do not perform time-consuming operations in this callback, and the data in this callback cannot be modified.
        Parameters:
        data - Audio data in PCM format.
        dataLength - Length of the data.
        param - Parameters of the audio frame.
      • onProcessRemoteAudioData

        public void onProcessRemoteAudioData​(java.nio.ByteBuffer data,
                                             int dataLength,
                                             ZegoAudioFrameParam param,
                                             java.lang.String streamID,
                                             double timestamp)
        Custom audio processing remote playing stream PCM audio frame callback. Available: Since 2.13.0 Description: In this callback, you can receive the PCM audio frames of remote playing stream. Developers can modify the audio frame data, as well as the audio channels and sample rate. The timestamp can be used for data synchronization, such as lyrics, etc. When to trigger: You need to call [enableCustomAudioRemoteProcessing] to enable the function first, and call [startPlayingStream] to trigger this callback function. Restrictions: None. Caution: This callback is a high-frequency callback, please do not perform time-consuming operations in this callback.
        Parameters:
        data - Audio data in PCM format.
        dataLength - Length of the data.
        param - Parameters of the audio frame.
        streamID - Corresponding stream ID.
        timestamp - The audio frame timestamp, starting from 0 when capture is started, the unit is milliseconds.
      • onProcessPlaybackAudioData

        public void onProcessPlaybackAudioData​(java.nio.ByteBuffer data,
                                               int dataLength,
                                               ZegoAudioFrameParam param,
                                               double timestamp)
        Custom audio processing SDK playback PCM audio frame callback. Available: Since 2.13.0 Description: In this callback, you can receive the SDK playback PCM audio frame. Developers can modify the audio frame data, as well as the audio channels and sample rate. The timestamp can be used for data synchronization, such as lyrics, etc. When to trigger: You need to call [enableCustomAudioPlaybackProcessing] to enable the function first, and call [startPublishingStream], [startPlayingStream], [startPreview], [createMediaPlayer] or [createAudioEffectPlayer] to trigger this callback function. Restrictions: None. Caution: This callback is a high-frequency callback, please do not perform time-consuming operations in this callback.
        Parameters:
        data - Audio data in PCM format.
        dataLength - Length of the data.
        param - Parameters of the audio frame.
        timestamp - The audio frame timestamp, starting from 0 when capture is started, the unit is milliseconds (It is effective when there is one and only one stream).