IZegoCustomAudioProcessHandler
IZegoCustomAudioProcessHandler
Declared in callback/IZegoCustomAudioProcessHandler.java
Methods
onProcessCapturedAudioData
public void onProcessCapturedAudioData(ByteBuffer data, int dataLength, ZegoAudioFrameParam param, double timestamp)callback/IZegoCustomAudioProcessHandler.javaParameters
| Name | Type | Description |
|---|---|---|
| data | ByteBuffer | Audio data in PCM format. |
| dataLength | int | Length of the data. |
| param | ZegoAudioFrameParam | Parameters of the audio frame. |
| timestamp | double | The 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
public void onProcessCapturedAudioDataAfterUsedHeadphoneMonitor(ByteBuffer data, int dataLength, ZegoAudioFrameParam param, double timestamp)callback/IZegoCustomAudioProcessHandler.javaParameters
| Name | Type | Description |
|---|---|---|
| data | ByteBuffer | Audio data in PCM format |
| dataLength | int | Length of the data |
| param | ZegoAudioFrameParam | Parameters of the audio frame |
| timestamp | double | The 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
public void onAlignedAudioAuxData(ByteBuffer data, int dataLength, ZegoAudioFrameParam param)callback/IZegoCustomAudioProcessHandler.javaParameters
| Name | Type | Description |
|---|---|---|
| data | ByteBuffer | Audio data in PCM format. |
| dataLength | int | Length of the data. |
| param | ZegoAudioFrameParam | Parameters 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
public void onBeforeAudioPrepAudioData(ByteBuffer data, int dataLength, ZegoAudioFrameParam param)callback/IZegoCustomAudioProcessHandler.javaParameters
| Name | Type | Description |
|---|---|---|
| data | ByteBuffer | Audio data in PCM format. |
| dataLength | int | Length of the data. |
| param | ZegoAudioFrameParam | Parameters 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
public void onProcessRemoteAudioData(ByteBuffer data, int dataLength, ZegoAudioFrameParam param, String streamID, double timestamp)callback/IZegoCustomAudioProcessHandler.javaParameters
| Name | Type | Description |
|---|---|---|
| data | ByteBuffer | Audio data in PCM format. |
| dataLength | int | Length of the data. |
| param | ZegoAudioFrameParam | Parameters of the audio frame. |
| streamID | String | Corresponding stream ID. |
| timestamp | double | The 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
public void onProcessPlaybackAudioData(ByteBuffer data, int dataLength, ZegoAudioFrameParam param, double timestamp)callback/IZegoCustomAudioProcessHandler.javaParameters
| Name | Type | Description |
|---|---|---|
| data | ByteBuffer | Audio data in PCM format. |
| dataLength | int | Length of the data. |
| param | ZegoAudioFrameParam | Parameters of the audio frame. |
| timestamp | double | 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). |
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.
