logo
On this page

IZegoCustomAudioProcessHandler

IZegoCustomAudioProcessHandler

Declared in callback/IZegoCustomAudioProcessHandler.java

Methods

onProcessCapturedAudioData

onProcessCapturedAudioData
public void onProcessCapturedAudioData(ByteBuffer data, int dataLength, ZegoAudioFrameParam param, double timestamp)
Custom audio processing local captured PCM audio frame callback.
Declared in callback/IZegoCustomAudioProcessHandler.java

Parameters

NameTypeDescription
dataByteBufferAudio data in PCM format.
dataLengthintLength of the data.
paramZegoAudioFrameParamParameters of the audio frame.
timestampdoubleThe audio frame timestamp, starting from 0 when capture is started, the unit is milliseconds.

Details

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 [startPreview] 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.
  • Restrictions: None.

onProcessCapturedAudioDataAfterUsedHeadphoneMonitor

onProcessCapturedAudioDataAfterUsedHeadphoneMonitor
public void onProcessCapturedAudioDataAfterUsedHeadphoneMonitor(ByteBuffer data, int dataLength, ZegoAudioFrameParam param, double timestamp)
Custom audio processing local captured PCM audio frame callback after used headphone monitor.
Declared in callback/IZegoCustomAudioProcessHandler.java

Parameters

NameTypeDescription
dataByteBufferAudio data in PCM format
dataLengthintLength of the data
paramZegoAudioFrameParamParameters of the audio frame
timestampdoubleThe audio frame timestamp, starting from 0 when capture is started, the unit is milliseconds.

Details

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 [startPreview] 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.

onAlignedAudioAuxData

onAlignedAudioAuxData
public void onAlignedAudioAuxData(ByteBuffer data, int dataLength, ZegoAudioFrameParam param)
Aligned audio aux frames callback.
Declared in callback/IZegoCustomAudioProcessHandler.java

Parameters

NameTypeDescription
dataByteBufferAudio data in PCM format.
dataLengthintLength of the data.
paramZegoAudioFrameParamParameters of the audio frame.

Details

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.

  • 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.
  • Restrictions: To obtain audio aux data of the media player from this callback, developers need to call [enableAux] and [start] of MediaPlayer.

onBeforeAudioPrepAudioData

onBeforeAudioPrepAudioData
public void onBeforeAudioPrepAudioData(ByteBuffer data, int dataLength, ZegoAudioFrameParam param)
Audio data callback before SDK internal audio preprocessing.
Declared in callback/IZegoCustomAudioProcessHandler.java

Parameters

NameTypeDescription
dataByteBufferAudio data in PCM format.
dataLengthintLength of the data.
paramZegoAudioFrameParamParameters of the audio frame.

Details

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.

  • 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.
  • Restrictions: None.

onProcessRemoteAudioData

onProcessRemoteAudioData
public void onProcessRemoteAudioData(ByteBuffer data, int dataLength, ZegoAudioFrameParam param, String streamID, double timestamp)
Custom audio processing remote playing stream PCM audio frame callback.
Declared in callback/IZegoCustomAudioProcessHandler.java

Parameters

NameTypeDescription
dataByteBufferAudio data in PCM format.
dataLengthintLength of the data.
paramZegoAudioFrameParamParameters of the audio frame.
streamIDStringCorresponding stream ID.
timestampdoubleThe audio frame timestamp, starting from 0 when capture is started, the unit is milliseconds.

Details

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.

  • Caution: This callback is a high-frequency callback, please do not perform time-consuming operations in this callback.
  • Restrictions: None.

onProcessPlaybackAudioData

onProcessPlaybackAudioData
public void onProcessPlaybackAudioData(ByteBuffer data, int dataLength, ZegoAudioFrameParam param, double timestamp)
Custom audio processing SDK playback PCM audio frame callback.
Declared in callback/IZegoCustomAudioProcessHandler.java

Parameters

NameTypeDescription
dataByteBufferAudio data in PCM format.
dataLengthintLength of the data.
paramZegoAudioFrameParamParameters of the audio frame.
timestampdoubleThe 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).

Details

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.

  • Caution: This callback is a high-frequency callback, please do not perform time-consuming operations in this callback.
  • Restrictions: None.

Previous

izegocopyrightedmusiceventhandler

Next

izegocustomvideocapturehandler

On this page

Back to top