Video Call
  • iOS
  • Android : Java
  • Web
  • Flutter
  • React Native
  • Electron
  • Unity3D
  • Cocos Creator
  • Windows
  • macOS
  • Linux
  • Overview
  • Develop your app
    • Quick start
    • Enhance basic feature
      • Use Tokens for authentication
      • Config your video based on scenes
      • Check the room connection status
      • Set up common video config
      • Set up common audio config
  • Best practices
    • Implement a video call for multiple users
    • Implement call invitation
    • Implement a live audio room
  • Upgrade using advanced features
    • Advanced features
      • Configure the video
        • Watermark the video/Take snapshots
        • Improve your appearance in the video
        • Beautify & Change the voice
        • Configure video codec
        • Output the video in H.265
      • Improve video quality
        • Configure bandwidth management
        • Test network and devices in advance
        • Visualize the sound level
        • Monitor streaming quality
      • Message signaling
        • Convey extra information using SEI
        • Broadcast real-time messages to a room
        • Quotas and limits
      • Play media files
        • Play media files
        • Play sound effects
      • Share the screen
      • Mix the video streams
      • Publish multiple video streams
      • Encrypt the video streams
      • Record video media data
    • Distincitve features
      • Join multiple rooms
      • Customize the video and audio
      • Set the voice hearing range
      • Transfer traffic via the cloud proxy server
      • Use the bit mask
      • Play streams via URL
      • Play a transparent gift special effect
      • AI Voice Changer
      • In-game voice chat
  • Upgrade using Add-on
  • Resources & Reference
    • SDK
    • Sample codes
    • API reference
      • Client APIs
      • Server APIs
    • Debugging
      • Error codes
      • Logging/Version number
    • FAQs
    • Key concepts
  • Documentation
  • Video Call
  • Resources & Reference
  • SDK
  • Upgrade guide
  • Upgrade guide v3.0.0+

Upgrade guide 3.0.0+

Last updated:2023-09-27 14:34

  • If your current SDK version is lower than 3.0.0, when you need to upgrade to any version of 3.0.0 or above. Please make sure to read this document.
  • In addition, it is recommended that you refer to the business-related interfaces changes in the Release notes between the current version and the target version.

This article provides general instructions and precautions when you upgrade the Express SDK version to 3.0.0 or above.

Deprecation notes

  1. Discard the three scenarios of General, Communication, and Live in the ZegoScenario scene enumeration.

  2. From version 3.0.0, Express iOS SDK no longer supports Bitcode. For more information, please refer to Xcode 14 Release Notes for instructions on deprecating Bitcode.

Adaptation method: Open the configuration page of the Xcode project, find the Enable Bitcode option in the Build Settings page of the App Target, and set it to No.

Delete description

Remove the following interfaces that were deprecated in previous versions.

method name Description
setDebugVerbose Set the debug detail switch and language. This function is deprecated in version 2.3.0. Please use enableDebugAssistant to implement the original function.
loginMultiRoom Multiple Rooms to MultiRoom. This method is deprecated after version 2.9.0. If you want to implement the multi-room function, please call the setRoomMode function before engine initialization to set the multi-room mode, and then set loginRoom to Multiple Rooms. If you call the loginRoom function, please make sure the same user information is included.
setPlayStreamVideoLayer Set to select the video layer for play streams video. This function is deprecated after version 2.3.0. Please use setPlayStreamVideoType instead.
enableAudioDataCallback Enable additional callback for receiving audio data. This function is deprecated in version 2.7.0. Please use startAudioDataObserver and stopAudioDataObserver instead.
setReverbParam Set the specific parameters of the Reverb. This function is deprecated after version 1.18.0. Please use setReverbPreset or setReverbAdvancedParam instead.
setBuiltInSpeakerOn Whether to use the built-in speaker to play sound. This function is deprecated after version 2.3.0. Please use setAudioRouteToSpeaker instead.
onRoomStreamUpdate Notification of stream increase or decrease pushed by other users in the same room. This callback function is deprecated in version 1.18.0. Please use the onRoomStreamUpdate function with the extendedData parameter.
onDeviceError Device exception notification. This function is deprecated in version 2.15.0 and above. Please use onLocalDeviceExceptionOccurred instead.
onNetworkQuality Reports the network quality of the stream in the room. This callback function is deprecated in version 2.10.0 and above. Please use the onNetworkQuality function with the ZegoStreamQualityLevel enumeration parameter.
onProcessCapturedAudioData Custom audio processing callback for local capture of PCM audio frames. This callback function is deprecated in version 2.13.0 and above. Please use the onProcessCapturedAudioData function with the timestamp parameter.
onProcessRemoteAudioData Custom audio processing callback for remote stream play of PCM audio frames. This callback function is deprecated in version 2.13.0 and above. Please use the onProcessRemoteAudioData function with the timestamp parameter.
onProcessPlaybackAudioData Custom audio processing SDK PCM audio frame callback for audio playing. This callback function is deprecated in version 2.13.0 and above. Please use the onProcessPlaybackAudioData function with the timestampparameter.

Change the sample code

You can refer to the following sample code to change the interface.

setDebugVerbose

Below version 3.0.0

Java
ZegoExpressEngine.getEngine().setDebugVerbose(true, ZegoLanguage.ENGLISH);
Objective-C
[[ZegoExpressEngine sharedEngine] setDebugVerbose:YES language:ZegoLanguageEnglish];
C++
ZegoExpressSDK::getEngine()->setDebugVerbose(true, ZEGO_LANGUAGE_ENGLISH);
Swift
ZegoExpressEngine.shared().setDebugVerbose(true, language: .english)

Version 3.0.0 or above

Java
// Note: Do not enable this feature in the online version. Use it only during the development phase.
// Note: Do not enable this feature in the online version. Use it only during the development phase."
ZegoExpressEngine.getEngine().enableDebugAssistant(true);
Objective-C
// Note: Do not enable this feature in the online version. Use it only during the development phase.
// Note: Do not enable this feature in the online version. Use it only during the development phase."
[[ZegoExpressEngine sharedEngine] enableDebugAssistant:YES];
C++
// Note: Do not enable this feature in the online version. Use it only during the development phase.
// Note: Do not enable this feature in the online version. Use it only during the development phase."
ZegoExpressSDK::getEngine()->enableDebugAssistant(true);
Swift
// Note: Do not enable this feature in the online version. Use it only during the development phase.
// Note: Do not enable this feature in the online version. Use it only during the development phase."
ZegoExpressEngine.shared().enableDebugAssistant(true);

loginMultiRoom

Below version 3.0.0

Java
ZegoExpressEngine.createEngine(profile, null);

ZegoUser user = new ZegoUser("user1");
ZegoExpressEngine.getEngine().loginRoom("first_room", user);
ZegoExpressEngine.getEngine().loginMultiRoom("second_room", null);
Objective-C
[ZegoExpressEngine createEngineWithProfile:profile eventHandler:nil];

ZegoUser *user = [ZegoUser userWithUserID:@"user1"];
[[ZegoExpressEngine sharedEngine] loginRoom:@"first_room" user:user];
[[ZegoExpressEngine sharedEngine] loginMultiRoom:@"second_room" config:nil];
C++
ZegoExpressSDK::createEngine(profile, nullptr);

auto user = ZegoUser("user1", "user1");
ZegoExpressSDK::getEngine()->loginRoom("first_room", user);
ZegoExpressSDK::getEngine()->loginMultiRoom("second_room");
Swift
ZegoExpressEngine.createEngine(with: profile, eventHandler: nil)

let user = ZegoUser(userID: "user1")
ZegoExpressEngine.shared().loginRoom("first_room", user: user)
ZegoExpressEngine.shared().loginMultiRoom("second_room", config: nil)

Version 3.0.0 or above

For the usage of related interfaces, please refer to Multiple Rooms.

Java
// It must be set before [`createEngine`] is called to take effect. Otherwise, it will fail.
// It must be set before [`createEngine`] is called to take effect. Otherwise, it will fail.
ZegoExpressEngine.setRoomMode(ZegoRoomMode.MULTI_ROOM);

ZegoExpressEngine.createEngine(profile, null);

ZegoUser user = new ZegoUser("user1");
ZegoExpressEngine.getEngine().loginRoom("first_room", user);
ZegoExpressEngine.getEngine().loginRoom("second_room", user);
Objective-C
// It must be set before [`createEngine`] is called to take effect. Otherwise, it will fail.
// It must be set before [`createEngine`] is called to take effect. Otherwise, it will fail.
[ZegoExpressEngine setRoomMode:ZegoRoomModeMultiRoom];

[ZegoExpressEngine createEngineWithProfile:profile eventHandler:nil];

ZegoUser *user = [ZegoUser userWithUserID:@"user1"];
[[ZegoExpressEngine sharedEngine] loginRoom:@"first_room" user:user];
[[ZegoExpressEngine sharedEngine] loginRoom:@"second_room" user:user];
C++
// It must be set before [`createEngine`] is called to take effect. Otherwise, it will fail.
// It must be set before [`createEngine`] is called to take effect. Otherwise, it will fail.
ZegoExpressSDK::setRoomMode(ZEGO_ROOM_MODE_MULTI_ROOM);

ZegoExpressSDK::createEngine(profile, nullptr);

auto user = ZegoUser("user1", "user1");
ZegoExpressSDK::getEngine()->loginRoom("first_room", user);
ZegoExpressSDK::getEngine()->loginRoom("second_room", user);
Swift
// It must be set before [`createEngine`] is called to take effect. Otherwise, it will fail.
// It must be set before [`createEngine`] is called to take effect. Otherwise, it will fail.
ZegoExpressEngine.setRoomMode(.multiRoom)

ZegoExpressEngine.createEngine(with: profile, eventHandler: nil)

let user = ZegoUser(userID: "user1")
ZegoExpressEngine.shared().loginRoom("first_room", user: user)
ZegoExpressEngine.shared().loginRoom("second_room", user: user)

setPlayStreamVideoLayer

Below version 3.0.0

Java
ZegoExpressEngine.getEngine().setPlayStreamVideoLayer("stream1", ZegoPlayerVideoLayer.AUTO);
Objective-C
[[ZegoExpressEngine sharedEngine] setPlayStreamVideoLayer:ZegoPlayerVideoLayerAuto streamID:@"stream1"];
C++
ZegoExpressSDK::getEngine()->setPlayStreamVideoLayer("stream1", ZEGO_PLAYER_VIDEO_LAYER_AUTO);
Swift
ZegoExpressEngine.shared().setPlayStreamVideoLayer(.auto, streamID: "stream1")

Version 3.0.0 or above

For the usage of related interfaces, please refer to Set Video Encoding Method.

Java
ZegoExpressEngine.getEngine().setPlayStreamVideoType("stream1", ZegoVideoStreamType.DEFAULT);
Objective-C
[[ZegoExpressEngine sharedEngine] setPlayStreamVideoType:ZegoVideoStreamTypeDefault streamID:@"stream1"];
C++
ZegoExpressSDK::getEngine()->setPlayStreamVideoType("stream1", ZEGO_VIDEO_STREAM_TYPE_DEFAULT);
Swift
ZegoExpressEngine.shared().setPlayStreamVideoType(.default, streamID: "stream1")

enableAudioDataCallback

Below version 3.0.0

Java
int bitmask = ZegoAudioDataCallbackBitMask.CAPTURED.value() | ZegoAudioDataCallbackBitMask.PLAYER.value();
ZegoAudioFrameParam param = new ZegoAudioFrameParam();
param.sampleRate = ZegoAudioSampleRate.ZEGO_AUDIO_SAMPLE_RATE_48K;
param.channel = ZegoAudioChannel.MONO;

// Start
ZegoExpressEngine.getEngine().setAudioDataHandler(handler);
ZegoExpressEngine.getEngine().enableAudioDataCallback(true, bitmask, param);

// Stop
ZegoExpressEngine.getEngine().setAudioDataHandler(null);
ZegoExpressEngine.getEngine().enableAudioDataCallback(false, bitmask, param);
Objective-C
int bitmask = ZegoAudioDataCallbackBitMaskCaptured | ZegoAudioDataCallbackBitMaskPlayer;
ZegoAudioFrameParam *param = [[ZegoAudioFrameParam alloc] init];
param.sampleRate = ZegoAudioSampleRate48K;
param.channel = ZegoAudioChannelMono;

// Start
[[ZegoExpressEngine sharedEngine] setAudioDataHandler:self];
[[ZegoExpressEngine sharedEngine] enableAudioDataCallback:YES callbackBitMask:bitmask param:param];

// Stop
[[ZegoExpressEngine sharedEngine] setAudioDataHandler:nil];
[[ZegoExpressEngine sharedEngine] enableAudioDataCallback:NO callbackBitMask:bitmask param:param];
C++
auto bitmask = ZEGO_AUDIO_DATA_CALLBACK_BIT_MASK_CAPTURED | ZEGO_AUDIO_DATA_CALLBACK_BIT_MASK_PLAYER;
auto param = ZegoAudioFrameParam();
param.sampleRate = ZEGO_AUDIO_SAMPLE_RATE_48K;
param.channel = ZEGO_AUDIO_CHANNEL_MONO;

// Start
ZegoExpressSDK::getEngine()->setAudioDataHandler(handler);
ZegoExpressSDK::getEngine()->enableAudioDataCallback(true, bitmask, param);

// Stop
ZegoExpressSDK::getEngine()->setAudioDataHandler(nullptr);
ZegoExpressSDK::getEngine()->enableAudioDataCallback(false, bitmask, param);
Swift
let param = ZegoAudioFrameParam()
param.sampleRate = .rate48K
param.channel = .mono

// Start
ZegoExpressEngine.shared().setAudioDataHandler(self)
ZegoExpressEngine.shared().enableAudioDataCallback(true, callbackBitMask: [.captured, .player], param: param)

// Stop
ZegoExpressEngine.shared().setAudioDataHandler(nil)
ZegoExpressEngine.shared().enableAudioDataCallback(false, callbackBitMask: [.captured, .player], param: param)

Version 3.0.0 or above

Java
int bitmask = ZegoAudioDataCallbackBitMask.CAPTURED.value() | ZegoAudioDataCallbackBitMask.PLAYER.value();
ZegoAudioFrameParam param = new ZegoAudioFrameParam();
param.sampleRate = ZegoAudioSampleRate.ZEGO_AUDIO_SAMPLE_RATE_48K;
param.channel = ZegoAudioChannel.MONO;

// Start
ZegoExpressEngine.getEngine().setAudioDataHandler(handler);
ZegoExpressEngine.getEngine().startAudioDataObserver(bitmask, param);

// Stop
ZegoExpressEngine.getEngine().setAudioDataHandler(null);
ZegoExpressEngine.getEngine().stopAudioDataObserver();
Objective-C
int bitmask = ZegoAudioDataCallbackBitMaskCaptured | ZegoAudioDataCallbackBitMaskPlayer;
ZegoAudioFrameParam *param = [[ZegoAudioFrameParam alloc] init];
param.sampleRate = ZegoAudioSampleRate48K;
param.channel = ZegoAudioChannelMono;

// Start
[[ZegoExpressEngine sharedEngine] setAudioDataHandler:self];
[[ZegoExpressEngine sharedEngine] startAudioDataObserver:bitmask param:param];

// Stop
[[ZegoExpressEngine sharedEngine] setAudioDataHandler:nil];
[[ZegoExpressEngine sharedEngine] stopAudioDataObserver];
C++
auto bitmask = ZEGO_AUDIO_DATA_CALLBACK_BIT_MASK_CAPTURED | ZEGO_AUDIO_DATA_CALLBACK_BIT_MASK_PLAYER;
auto param = ZegoAudioFrameParam();
param.sampleRate = ZEGO_AUDIO_SAMPLE_RATE_48K;
param.channel = ZEGO_AUDIO_CHANNEL_MONO;

// Start
ZegoExpressSDK::getEngine()->setAudioDataHandler(handler);
ZegoExpressSDK::getEngine()->startAudioDataObserver(bitmask, param);

// Stop
ZegoExpressSDK::getEngine()->setAudioDataHandler(nullptr);
ZegoExpressSDK::getEngine()->stopAudioDataObserver();
Swift
let param = ZegoAudioFrameParam()
param.sampleRate = .rate48K
param.channel = .mono

// Start
ZegoExpressEngine.shared().setAudioDataHandler(self)
ZegoExpressEngine.shared().startAudioDataObserver([.captured, .player], param: param)

// Stop
ZegoExpressEngine.shared().setAudioDataHandler(nil)
ZegoExpressEngine.shared().stopAudioDataObserver()

setReverbParam

Below version 3.0.0

Java
ZegoReverbParam param = new ZegoReverbParam(ZegoReverbPreset.BASEMENT);
ZegoExpressEngine.getEngine().setReverbParam(param);
Objective-C
ZegoReverbParam *param = [ZegoReverbParam paramWithPreset:ZegoReverbPresetBasement];
[[ZegoExpressEngine sharedEngine] setReverbParam:param];
C++
auto param = ZegoReverbParam(ZEGO_REVERB_PRESET_BASEMENT);
ZegoExpressSDK::getEngine()->setReverbParam(param);
Swift
let param = ZegoReverbParam(preset: .basement)
ZegoExpressEngine.shared().setReverbParam(param)

Version 3.0.0 or above

Java
ZegoExpressEngine.getEngine().setReverbPreset(ZegoReverbPreset.BASEMENT);

ZegoReverbAdvancedParam param = new ZegoReverbAdvancedParam();
ZegoExpressEngine.getEngine().setReverbAdvancedParam(param);
Objective-C
[[ZegoExpressEngine sharedEngine] setReverbPreset:ZegoReverbPresetBasement];

ZegoReverbAdvancedParam *param = [[ZegoReverbAdvancedParam alloc] init];
[[ZegoExpressEngine sharedEngine] setReverbAdvancedParam:param];
C++
ZegoExpressSDK::getEngine()->setReverbPreset(ZEGO_REVERB_PRESET_BASEMENT);

auto param = ZegoReverbAdvancedParam();
ZegoExpressSDK::getEngine()->setReverbAdvancedParam(param);
Swift
ZegoExpressEngine.shared().setReverbPreset(.basement)

let param = ZegoReverbAdvancedParam()
ZegoExpressEngine.shared().setReverbAdvancedParam(param)

setBuiltInSpeakerOn

Below version 3.0.0

Java
ZegoExpressEngine.getEngine().setBuiltInSpeakerOn(true);
Objective-C
[[ZegoExpressEngine sharedEngine] setBuiltInSpeakerOn:YES];
C++
ZegoExpressSDK::getEngine()->setBuiltInSpeakerOn(true);
Swift
ZegoExpressEngine.shared().setBuiltInSpeakerOn(true)

Version 3.0.0 or above

Java
ZegoExpressEngine.getEngine().setAudioRouteToSpeaker(true);
Objective-C
[[ZegoExpressEngine sharedEngine] setAudioRouteToSpeaker:YES];
C++
ZegoExpressSDK::getEngine()->setAudioRouteToSpeaker(true);
Swift
ZegoExpressEngine.shared().setAudioRouteToSpeaker(true)

onRoomStreamUpdate

Below version 3.0.0

Java
@Override
public void onRoomStreamUpdate(String roomID, ZegoUpdateType updateType, ArrayList<ZegoStream> streamList) {
    super.onRoomStreamUpdate(roomID, updateType, streamList);
    // Handle room streams
    // Handling flow changes in the room
}
Objective-C
- (void)onRoomStreamUpdate:(ZegoUpdateType)updateType streamList:(NSArray<ZegoStream *> *)streamList roomID:(NSString *)roomID {
    // Handle room streams
    // Handling flow changes in the room
}
C++
// Handle room streams
// Handling flow changes in the room
void onRoomStreamUpdate(const std::string& roomID, ZegoUpdateType updateType, const std::vector<ZegoStream>& streamList) override;
Swift
func onRoomStreamUpdate(_ updateType: ZegoUpdateType, streamList: [ZegoStream], roomID: String) {
    // Handle room streams
    // Handling flow changes in the room
}

Version 3.0.0 or above

Java
@Override
public void onRoomStreamUpdate(String roomID, ZegoUpdateType updateType, ArrayList<ZegoStream> streamList, JSONObject extendedData) {
    super.onRoomStreamUpdate(roomID, updateType, streamList, extendedData);
    // Handle room streams
    // Handling flow changes in the room
}
Objective-C
- (void)onRoomStreamUpdate:(ZegoUpdateType)updateType streamList:(NSArray<ZegoStream *> *)streamList extendedData:(NSDictionary *)extendedData roomID:(NSString *)roomID {
    // Handle room streams
    // Handling flow changes in the room
}
C++
// Handle room streams
// Handling flow changes in the room
void onRoomStreamUpdate(const std::string& roomID, ZegoUpdateType updateType, const std::vector<ZegoStream>& streamList, const std::string& extendData) override;
Swift
func onRoomStreamUpdate(_ updateType: ZegoUpdateType, streamList: [ZegoStream], extendedData: [AnyHashable : Any]?, roomID: String) {
    // Handle room streams
    // Handling flow changes in the room
}

onDeviceError

Below version 3.0.0

Java
@Override
public void onDeviceError(int errorCode, String deviceName) {
    super.onDeviceError(errorCode, deviceName);
    // Handle device error
    // Handling device errors
}
Objective-C
- (void)onDeviceError:(int)errorCode deviceName:(NSString *)deviceName {
    // Handle device error
    // Handling device errors
}
C++
// Handle device error
// Handling device errors
void onDeviceError(int errorCode, const std::string& deviceName) override;
Swift
func onDeviceError(_ errorCode: Int32, deviceName: String) {
    // Handle device error
    // Handling device errors
}

Version 3.0.0 or above

Java
@Override
public void onLocalDeviceExceptionOccurred(ZegoDeviceExceptionType exceptionType, ZegoDeviceType deviceType, String deviceID) {
    super.onLocalDeviceExceptionOccurred(exceptionType, deviceType, deviceID);
    // Handle device error
    // Handling device errors
}
Objective-C
- (void)onLocalDeviceExceptionOccurred:(ZegoDeviceExceptionType)exceptionType deviceType:(ZegoDeviceType)deviceType deviceID:(NSString *)deviceID {
    // Handle device error
    // Handling device errors
}
C++
// Handle device error
// Handling device errors
void onLocalDeviceExceptionOccurred(ZegoDeviceExceptionType exceptionType, ZegoDeviceType deviceType, const std::string &deviceID) override;
Swift
func onLocalDeviceExceptionOccurred(_ exceptionType: ZegoDeviceExceptionType, deviceType: ZegoDeviceType, deviceID: String) {
    // Handle device error
    // Handling device errors
}

onNetworkQuality

Below version 3.0.0

Java
@Override
public void onNetworkQuality(String streamID, int txQuality, int rxQuality) {
    super.onNetworkQuality(streamID, txQuality, rxQuality);
    // Handle network quality
    // Handling network quality
}
Objective-C
- (void)onNetworkQuality:(NSString *)streamID txQuality:(int)txQuality rxQuality:(int)rxQuality {
    // Handle network quality
    // Handling network quality
}
C++
// Handle network quality
// Handling network quality
void onNetworkQuality(const char *streamID, int txQuality, int rxQuality) override;
Swift
func onNetworkQuality(_ streamID: String, txQuality: Int32, rxQuality: Int32) {
    // Handle network quality
    // Handling network quality
}

Version 3.0.0 or above

Java
@Override
public void onNetworkQuality(String userID, ZegoStreamQualityLevel upstreamQuality, ZegoStreamQualityLevel downstreamQuality) {
    super.onNetworkQuality(userID, upstreamQuality, downstreamQuality);
    // Handle network quality
    // Handling network quality
}
Objective-C
- (void)onNetworkQuality:(NSString *)userID upstreamQuality:(ZegoStreamQualityLevel)upstreamQuality downstreamQuality:(ZegoStreamQualityLevel)downstreamQuality {
    // Handle network quality
    // Handling network quality
}
C++
// Handle network quality
// Handling network quality
void onNetworkQuality(const std::string &userID, ZegoStreamQualityLevel upstreamQuality, ZegoStreamQualityLevel downstreamQuality) override;
Swift
func onNetworkQuality(_ userID: String, upstreamQuality: ZegoStreamQualityLevel, downstreamQuality: ZegoStreamQualityLevel) {
    // Handle network quality
    // Handling network quality
}

onProcessCapturedAudioData / onProcessRemoteAudioData / onProcessPlaybackAudioData

Below version 3.0.0

Java
ZegoExpressEngine.getEngine().setCustomAudioProcessHandler(new IZegoCustomAudioProcessHandler() {
    @Override
    public void onProcessCapturedAudioData(ByteBuffer data, int dataLength, ZegoAudioFrameParam param) {
        super.onProcessCapturedAudioData(data, dataLength, param);
        // Handle captured audio data
        // Handle locally captured audio data
    }

    @Override
    public void onProcessRemoteAudioData(ByteBuffer data, int dataLength, ZegoAudioFrameParam param, String streamID) {
        super.onProcessRemoteAudioData(data, dataLength, param, streamID);
        // Handle remote audio data
        // Handle remote audio play streams
    }

    @Override
    public void onProcessPlaybackAudioData(ByteBuffer data, int dataLength, ZegoAudioFrameParam param) {
        super.onProcessPlaybackAudioData(data, dataLength, param);
        // Handle playback audio data
        // Handle playback audio data
    }
});
Objective-C
- (void)onProcessCapturedAudioData:(unsigned char *)data dataLength:(unsigned int)dataLength param:(ZegoAudioFrameParam *)param {
    // Handle captured audio data
    // Handle locally captured audio data
}

- (void)onProcessRemoteAudioData:(unsigned char *)data dataLength:(unsigned int)dataLength param:(ZegoAudioFrameParam *)param streamID:(NSString *)streamID {
    // Handle remote audio data
    // Handle remote audio stream play
}

- (void)onProcessPlaybackAudioData:(unsigned char *)data dataLength:(unsigned int)dataLength param:(ZegoAudioFrameParam *)param {
    // Handle playback audio data
    // Handle playback audio data
}
C++
// Handle captured audio data
// Handle locally captured audio data
void onProcessCapturedAudioData(unsigned char *data, unsigned int dataLength, ZegoAudioFrameParam *param) override;

// Handle remote audio data
// Handle remote audio stream play
void onProcessRemoteAudioData(unsigned char *data, unsigned int dataLength, ZegoAudioFrameParam *param, const std::string &streamID) override;

// Handle playback audio data
// Handle playback audio data
void onProcessPlaybackAudioData(unsigned char *data, unsigned int dataLength, ZegoAudioFrameParam *param) override;
Swift
func onProcessCapturedAudioData(_ data: UnsafeMutablePointer<UInt8>, dataLength: UInt32, param: ZegoAudioFrameParam) {
    // Handle captured audio data
    // Handle locally captured audio data
}

func onProcessRemoteAudioData(_ data: UnsafeMutablePointer<UInt8>, dataLength: UInt32, param: ZegoAudioFrameParam, streamID: String) {
    // Handle remote audio data
    // Handle remote audio stream play
}

func onProcessPlaybackAudioData(_ data: UnsafeMutablePointer<UInt8>, dataLength: UInt32, param: ZegoAudioFrameParam) {
    // Handle playback audio data
    // Handle playback audio data
}

Version 3.0.0 or above

Java
ZegoExpressEngine.getEngine().setCustomAudioProcessHandler(new IZegoCustomAudioProcessHandler() {
    @Override
    public void onProcessCapturedAudioData(ByteBuffer data, int dataLength, ZegoAudioFrameParam param, double timestamp) {
        super.onProcessCapturedAudioData(data, dataLength, param, timestamp);
        // Handle captured audio data
        // Handle locally captured audio data
    }

    @Override
    public void onProcessRemoteAudioData(ByteBuffer data, int dataLength, ZegoAudioFrameParam param, String streamID, double timestamp) {
        super.onProcessRemoteAudioData(data, dataLength, param, streamID, timestamp);
        // Handle remote audio data
        // Handle remote audio stream play
    }

    @Override
    public void onProcessPlaybackAudioData(ByteBuffer data, int dataLength, ZegoAudioFrameParam param, double timestamp) {
        super.onProcessPlaybackAudioData(data, dataLength, param, timestamp);
        // Handle playback audio data
        // Handle playback audio data
    }
});
Objective-C
- (void)onProcessCapturedAudioData:(unsigned char *)data dataLength:(unsigned int)dataLength param:(ZegoAudioFrameParam *)param timestamp:(double)timestamp {
    // Handle captured audio data
    // Handle locally captured audio data
}

- (void)onProcessRemoteAudioData:(unsigned char *)data dataLength:(unsigned int)dataLength param:(ZegoAudioFrameParam *)param streamID:(NSString *)streamID timestamp:(double)timestamp {
    // Handle remote audio data
    // Handle remote audio stream play
}

- (void)onProcessPlaybackAudioData:(unsigned char *)data dataLength:(unsigned int)dataLength param:(ZegoAudioFrameParam *)param timestamp:(double)timestamp {
    // Handle playback audio data
    // Handle playback audio data
}
C++
// Handle captured audio data
// Handle locally captured audio data
void onProcessCapturedAudioData(unsigned char *data, unsigned int dataLength, ZegoAudioFrameParam *param, double timestamp) override;

// Handle remote audio data
// Handle remote audio stream play
void onProcessRemoteAudioData(unsigned char *data, unsigned int dataLength, ZegoAudioFrameParam *param, const std::string &streamID, double timestamp) override;

// Handle playback audio data
// Handle playback audio data
void onProcessPlaybackAudioData(unsigned char *data, unsigned int dataLength, ZegoAudioFrameParam *param, double timestamp) override;
Swift
func onProcessCapturedAudioData(_ data: UnsafeMutablePointer<UInt8>, dataLength: UInt32, param: ZegoAudioFrameParam, timestamp: Double) {
    // Handle captured audio data
    // Handle locally captured audio data
}

func onProcessRemoteAudioData(_ data: UnsafeMutablePointer<UInt8>, dataLength: UInt32, param: ZegoAudioFrameParam, streamID: String, timestamp: Double) {
    // Handle remote audio data
    // Handle remote audio stream play
}

func onProcessRemoteAudioData(_ data: UnsafeMutablePointer<UInt8>, dataLength: UInt32, param: ZegoAudioFrameParam, streamID: String, timestamp: Double) {
    // Handle playback audio data
    // Handle playback audio data
}
Page Directory