Documentation
Express_Audio_SDK_API Voice Call
Documentation
Demo APP
SDK Center
API Center
FAQ
Code Market
Console
Sign Up
Log In
中文站 English
  • Documentation
  • Voice Call
  • Function Overview
  • Function Overview

Function Overview

Last updated:2023-06-15 16:30

ZEGO SDK has network nodes that fully cover key areas of the world, provides rich APIs, and provides clear and stable real-time voice and video cloud services for multiple terminals.

For the error codes returned by the API, please refer to: https://doc-zh.zego.im/article/5690.

The following is a brief introduction to the basic API.

main

Method Description
CreateEngine Create ZegoExpressEngine singleton object and initialize SDK.
DestroyEngine Destroy the ZegoExpressEngine singleton object and deinitialize the SDK.
GetEngine Returns the singleton instance of ZegoExpressEngine.
SetEngineConfig Set advanced engine configuration.
SetLogConfig Set log configuration.
SetLocalProxyConfig Set local proxy config.
SetCloudProxyConfig Set cloud proxy config.
SetRoomMode Set room mode.
GetVersion Gets the SDK's version number.
IsFeatureSupported Query whether the current SDK supports the specified feature.
SetRoomScenario Set room scenario.
UploadLog Uploads logs to the ZEGO server.
EnableDebugAssistant Enable the debug assistant. Note, do not enable this feature in the online version! Use only during development phase!
CallExperimentalAPI Call the experimental API.
OnDebugError The callback for obtaining debugging error information.
OnApiCalledResult Method execution result callback
OnEngineStateUpdate The callback triggered when the audio/video engine state changes.
OnRecvExperimentalAPI Experimental API callback

room

Method Description
LoginRoom Logs in to a room with advanced room configurations. You must log in to a room before publishing or playing streams.
LoginRoom Log in to the room by configuring advanced properties, and return the login result through the callback parameter. You must log in to the room before pushing or pulling the stream.
LogoutRoom Exit the room with callback.
LogoutRoom Exit the room of the specified room ID with callback.
SwitchRoom Switch the room with advanced room configurations.
RenewToken Renew token.
SetRoomExtraInfo Set room extra information.
OnRoomStateUpdate Notification of the room connection state changes.
OnRoomStateChanged Notification of the room connection state changes, including specific reasons for state change.
OnRoomUserUpdate The callback triggered when the number of other users in the room increases or decreases.
OnRoomOnlineUserCountUpdate The callback triggered every 30 seconds to report the current number of online users.
OnRoomStreamUpdate The callback triggered when the number of streams published by the other users in the same room increases or decreases.
OnRoomStreamExtraInfoUpdate The callback triggered when there is an update on the extra information of the streams published by other users in the same room.
OnRoomExtraInfoUpdate The callback triggered when there is an update on the extra information of the room.
OnRoomTokenWillExpire Callback notification that room Token authentication is about to expire.

publisher

Method Description
StartPublishingStream Starts publishing a stream (for the specified channel). You can call this function to publish a second stream.
StartPublishingStream Starts publishing a stream. Support multi-room mode.
StartPublishingStreamInScene Starts publishing a stream in RangeScene scene.
StopPublishingStream Stops publishing a stream (for the specified channel).
SetStreamExtraInfo Sets the extra information of the stream being published for the specified publish channel.
StartPreview Starts/Updates the local video preview (for the specified channel).
StopPreview Stops the local preview (for the specified channel).
SetVideoConfig Sets up the video configurations (for the specified channel).
GetVideoConfig Gets the current video configurations (for the specified channel).
SetVideoMirrorMode Sets the video mirroring mode (for the specified channel).
SetAppOrientation Sets the video orientation (for the specified channel).
SetAudioConfig Sets up the audio configurations for the specified publish channel.
GetAudioConfig Gets the current audio configurations from the specified publish channel.
TakePublishStreamSnapshot Take a snapshot of the publishing stream for the specified publish channel.
MutePublishStreamAudio Stops or resumes sending the audio part of a stream for the specified channel.
MutePublishStreamVideo Stops or resumes sending the video part of a stream for the specified channel.
SetStreamAlignmentProperty Enable or disable the stream mixing precision alignment function.
EnableTrafficControl Enables or disables traffic control.
SetMinVideoBitrateForTrafficControl Sets the minimum video bitrate for traffic control for the specified publish channel.
SetMinVideoFpsForTrafficControl Sets the minimum video frame rate threshold for traffic control.
SetMinVideoResolutionForTrafficControl Sets the minimum video resolution threshold for traffic control.
SetTrafficControlFocusOn Set the factors of concern that trigger traffic control for the specified publish channel.
SetCaptureVolume Sets the audio recording volume for stream publishing.
SetAudioCaptureStereoMode Set audio capture stereo mode.
AddPublishCdnUrl Adds a target CDN URL to which the stream will be relayed from ZEGO RTC server.
RemovePublishCdnUrl Deletes the specified CDN URL, which is used for relaying streams from ZEGO RTC server to CDN.
EnablePublishDirectToCDN Whether to directly push to CDN (without going through the ZEGO RTC server), for the specified channel.
SendSEI Sends Supplemental Enhancement Information to the specified publish channel.
EnableHardwareEncoder Enables or disables hardware encoding.
SetCapturePipelineScaleMode Sets the timing of video scaling in the video capture workflow. You can choose to do video scaling right after video capture (the default value) or before encoding.
SetLowlightEnhancement Set low light enhancement.
OnPublisherStateUpdate The callback triggered when the state of stream publishing changes.
OnPublisherQualityUpdate Callback for current stream publishing quality.
OnPublisherCapturedAudioFirstFrame The callback triggered when the first audio frame is captured.
OnPublisherCapturedVideoFirstFrame The callback triggered when the first video frame is captured.
OnPublisherRenderVideoFirstFrame The callback triggered when the first video frame is rendered.
OnPublisherVideoSizeChanged The callback triggered when the video capture resolution changes.
OnPublisherRelayCDNStateUpdate The callback triggered when the state of relayed streaming to CDN changes.

player

Method Description
StartPlayingStream Starts playing a stream from ZEGO RTC server or from third-party CDN. Support multi-room mode.
StartPlayingStreamInScene Starts playing a stream from ZEGO RTC server or from third-party CDN, when using RangeScene, only for Unity.
StopPlayingStream Stops playing a stream.
TakePlayStreamSnapshot Take a snapshot of the playing stream.
SetPlayVolume Sets the stream playback volume.
SetAllPlayStreamVolume Sets the all stream playback volume.
SetPlayStreamVideoType Set play video stream type.
SetPlayStreamBufferIntervalRange Set the adaptive adjustment interval range of the buffer for playing stream.
SetPlayStreamFocusOn Set the weight of the pull stream priority.
MutePlayStreamAudio Whether the pull stream can receive the specified audio data.
MutePlayStreamVideo Whether the pull stream can receive the specified video data.
MuteAllPlayStreamAudio Can the pull stream receive all audio data.
MuteAllPlayStreamVideo Can the pull stream receive all video data.
EnableHardwareDecoder Enables or disables hardware decoding.
EnableCheckPoc Enables or disables frame order detection.
UpdatePlayingCanvas Update playing canvas.
OnPlayerStateUpdate The callback triggered when the state of stream playing changes.
OnPlayerQualityUpdate Callback for current stream playing quality.
OnPlayerMediaEvent The callback triggered when a media event occurs during streaming playing.
OnPlayerRecvAudioFirstFrame The callback triggered when the first audio frame is received.
OnPlayerRecvVideoFirstFrame The callback triggered when the first video frame is received.
OnPlayerRenderVideoFirstFrame The callback triggered when the first video frame is rendered.
OnPlayerRenderCameraVideoFirstFrame Calls back when the stream playing end renders the first frame of the video from the remote camera.
OnPlayerVideoSizeChanged The callback triggered when the stream playback resolution changes.
OnPlayerRecvSEI The callback triggered when Supplemental Enhancement Information is received.
OnPlayerSyncRecvSEI The callback triggered when Supplemental Enhancement Information is received synchronously.

IM

Method Description
CreateRealTimeSequentialDataManager Create the real time sequential data manager instance
DestroyRealTimeSequentialDataManager Destroy the real time sequential data manager instance
StartBroadcasting Start broadcasting real-time sequential data stream.
StopBroadcasting Stop broadcasting real-time sequential data stream.
SendRealTimeSequentialData Send real-time sequential data to the broadcasting stream ID.
StartSubscribing Start subscribing real-time sequential data stream.
StopSubscribing Stop subscribing real-time sequential data stream.
GetIndex Get real-time sequential data manager index.
OnReceiveRealTimeSequentialData Callback for receiving real-time sequential data.
SendBroadcastMessage Sends a Broadcast Message.
SendBarrageMessage Sends a Barrage Message (bullet screen) to all users in the same room, without guaranteeing the delivery.
SendCustomCommand Sends a Custom Command to the specified users in the same room.
OnIMRecvBroadcastMessage The callback triggered when Broadcast Messages are received.
OnIMRecvBarrageMessage The callback triggered when Barrage Messages are received.
OnIMRecvCustomCommand The callback triggered when a Custom Command is received.

mixer

Method Description
StartMixerTask Starts a stream mixing task.
StopMixerTask Stops a stream mixing task.
StartAutoMixerTask Starts an auto stream mixing task.
StopAutoMixerTask Stops an auto stream mixing task.
OnMixerRelayCDNStateUpdate The callback triggered when the state of relayed streaming of the mixed stream to CDN changes.
OnMixerSoundLevelUpdate The callback triggered when the sound level of any input stream changes in the stream mixing process.
OnAutoMixerSoundLevelUpdate The callback triggered when the sound level of any input stream changes in the auto stream mixing process.

preprocess

Method Description
EnableAEC Whether to enable acoustic echo cancellation (AEC).
EnableHeadphoneAEC Whether to turn on acoustic echo cancellation (AEC) when using the headphone.
SetAECMode Sets the acoustic echo cancellation (AEC) mode.
EnableAGC Enables or disables automatic gain control (AGC).
EnableANS Enables or disables active noise suppression (ANS, aka ANC).
EnableTransientANS Enables or disables transient noise suppression.
SetANSMode Sets the automatic noise suppression (ANS) mode.
SetVoiceChangerPreset Setting up the voice changer via preset enumeration.
SetVoiceChangerParam Setting up the specific voice changer parameters.
SetReverbPreset Setting up the reverberation via preset enumeration.
SetReverbAdvancedParam Setting up the specific reverberation parameters.
SetReverbEchoParam Setting up the specific reverberation echo parameters.
EnableVirtualStereo Enable or disable the virtual stereo effect when publishing stream.
EnablePlayStreamVirtualStereo Enable or disable the virtual stereo effect when playing stream.

mediaPlayer

Method Description
CreateMediaPlayer Creates a media player instance.
DestroyMediaPlayer Destroys a media player instance.
SetVideoHandler Set video data callback handler of the media player.
SetAudioHandler Set audio data callback handler of the media player.
LoadResource Load local or network media resource.
LoadResourceWithPosition Load local or network media resource and specify the start position.
LoadResourceFromMediaData Load binary audio resource.
LoadCopyrightedMusicResourceWithPosition Load copyrighted music resource.
Start Start playing.
Stop Stop playing.
Pause Pause playing.
Resume Resume playing.
SeekTo Set the specified playback progress.
EnableRepeat Whether to repeat playback.
SetPlayLoopCount Set the count of play loops.
SetPlaySpeed Set the speed of play.
EnableAux Whether to mix the player's sound into the stream being published.
MuteLocal Whether to play locally silently.
SetVolume Set mediaplayer volume. Both the local play volume and the publish volume are set.
SetPlayVolume Set mediaplayer local playback volume.
SetPublishVolume Set mediaplayer publish volume.
SetProgressInterval Set playback progress callback interval.
GetPlayVolume Gets the current local playback volume of the mediaplayer, the range is 0 ~ 200, with the default value of 60.
GetPublishVolume Gets the current publish volume of the mediaplayer, the range is 0 ~ 200, with the default value of 60.
GetTotalDuration Get the total progress of your media resources.
GetCurrentProgress Get current playing progress.
GetAudioTrackCount Get the number of audio tracks of the playback file.
SetAudioTrackIndex Set the audio track of the playback file.
SetVoiceChangerParam Setting up the specific voice changer parameters.
GetCurrentState Get the current playback status.
GetIndex Get media player index.
EnableAccurateSeek Enable accurate seek and set relevant attributes.
SetNetWorkResourceMaxCache Set the maximum cache duration and cache data size of web materials.
GetNetWorkResourceCache Get the playable duration and size of the cached data of the current network material cache queue
SetNetWorkBufferThreshold Use this interface to set the cache threshold that the media player needs to resume playback. The SDK default value is 5000ms,The valid value is greater than or equal to 1000ms
EnableSoundLevelMonitor Whether to enable sound level monitoring.
EnableFrequencySpectrumMonitor Whether to enable frequency spectrum monitoring.
UpdatePosition Update the position of the media player (audio source).
OnMediaPlayerStateUpdate MediaPlayer playback status callback.
OnMediaPlayerNetworkEvent The callback triggered when the network status of the media player changes.
OnMediaPlayerPlayingProgress The callback to report the current playback progress of the media player.
OnMediaPlayerRecvSEI The callback triggered when the media player got media side info.
OnMediaPlayerSoundLevelUpdate The callback of sound level update.
OnMediaPlayerFrequencySpectrumUpdate The callback of frequency spectrum update.
OnVideoFrame The callback triggered when the media player throws out video frame data, with additional information for the video frame.
OnAudioFrame The callback triggered when the media player throws out audio frame data.

audioEffectPlayer

Method Description
CreateAudioEffectPlayer Creates a audio effect player instance.
DestroyAudioEffectPlayer Destroys a audio effect player instance.
Start Start playing audio effect.
Stop Stop playing audio effect.
Pause Pause playing audio effect.
Resume Resume playing audio effect.
StopAll Stop playing all audio effect.
PauseAll Pause playing all audio effect.
ResumeAll Resume playing all audio effect.
SeekTo Set the specified playback progress.
SetVolume Set volume for a single audio effect. Both the local play volume and the publish volume are set.
SetVolumeAll Set volume for all audio effect. Both the local play volume and the publish volume are set.
GetTotalDuration Get the total duration of the specified audio effect resource.
GetCurrentProgress Get current playback progress.
LoadResource Load audio effect resource.
UnloadResource Unload audio effect resource.
UpdatePosition Update the position of the audio effect player (audio source).
GetIndex Get audio effect player index.
OnAudioEffectPlayStateUpdate Audio effect playback state callback.

record

Method Description
StartRecordingCapturedData Starts to record and directly save the data to a file.
StopRecordingCapturedData Stops recording locally captured audio or video.
OnCapturedDataRecordStateUpdate The callback triggered when the state of data recording (to a file) changes.
OnCapturedDataRecordProgressUpdate The callback to report the current recording progress.

device

Method Description
MuteMicrophone Mutes or unmutes the microphone.
IsMicrophoneMuted Checks whether the microphone is muted.
MuteSpeaker Mutes or unmutes the audio output speaker.
IsSpeakerMuted Checks whether the audio output speaker is muted.
GetAudioDeviceList Gets a list of audio devices.
GetAudioDeviceList Gets a list of audio devices.
UseAudioDevice Chooses to use the specified audio device.
EnableAudioCaptureDevice Enables or disables the audio capture device.
GetAudioRouteType get current audio route type.
SetAudioRouteToSpeaker Whether to use the built-in speaker to play audio.
EnableCamera Turns on/off the camera (for the specified channel).
UseFrontCamera Switches to the front or the rear camera (for the specified channel).
EnableCameraAdaptiveFPS Enable camera adaptive frame rate.
UseVideoDevice Chooses to use the specified video device (for the specified channel).
GetVideoDeviceList Gets a list of video devices.
GetVideoDeviceList Gets a list of video devices.
StartSoundLevelMonitor Starts sound level monitoring. Support setting the listening interval.
StartSoundLevelMonitor Starts sound level monitoring. Support enable some advanced feature.
StopSoundLevelMonitor Stops sound level monitoring.
StartAudioSpectrumMonitor Starts audio spectrum monitoring. Support setting the listening interval.
StopAudioSpectrumMonitor Stops audio spectrum monitoring.
EnableHeadphoneMonitor Enables or disables headphone monitoring.
SetHeadphoneMonitorVolume Sets the headphone monitor volume.
EnableMixSystemPlayout Enable or disable system audio capture.
SetMixSystemPlayoutVolume set system audio capture volume.
OnCapturedSoundLevelUpdate The local captured audio sound level callback.
OnCapturedSoundLevelInfoUpdate The local captured audio sound level callback, supported vad.
OnRemoteSoundLevelUpdate The remote playing streams audio sound level callback.
OnRemoteSoundLevelInfoUpdate The remote playing streams audio sound level callback, supported vad.
OnCapturedAudioSpectrumUpdate The local captured audio spectrum callback.
OnRemoteAudioSpectrumUpdate The remote playing streams audio spectrum callback.
OnLocalDeviceExceptionOccurred The callback triggered when a local device exception occurred.
OnRemoteCameraStateUpdate The callback triggered when the state of the remote camera changes.
OnRemoteMicStateUpdate The callback triggered when the state of the remote microphone changes.
OnRemoteSpeakerStateUpdate The callback triggered when the state of the remote speaker changes.
OnAudioRouteChange Callback for device's audio route changed.

customVideoIO

Method Description
EnableCustomVideoCapture Enables or disables custom video capture (for the specified channel).
SendCustomVideoCaptureRawData Sends the video frames (Raw Data) produced by custom video capture to the SDK (for the specified channel).
SendCustomVideoCaptureRawData Sends the video frames (Raw Data) produced by custom video capture to the SDK (for the specified channel).
OnCustomVideoCaptureStart Customize the notification of the start of video capture.
OnCustomVideoCaptureStop Customize the notification of the end of the collection.
EnableCustomVideoProcessing Enables or disables custom video processing, and support specifying the publish channel.
SendCustomVideoProcessedRawData Send the original video data after the pre-processing of the custom video to the SDK, and support other channels to push the stream.
SendCustomVideoProcessedCVPixelBuffer Send the [CVPixelBuffer] type video data after the custom video processing to the SDK (for the specified channel).
SendCustomVideoProcessedTextureData Send the [Texture] type video data after the pre-processing of the custom video to the SDK (for the specified channel).
OnCapturedUnprocessedRawData Call back when the original video data is obtained.
OnCapturedUnprocessedCVPixelBuffer Call back when the original video data of type [CVPixelBuffer] is obtained.
OnCapturedUnprocessedTextureData Call back when the original video data of type [Texture] is obtained.

customAudioIO

Method Description
StartAudioDataObserver Enable audio data observering.
StopAudioDataObserver Disable audio data observering.
EnableCustomAudioIO Enables the custom audio I/O function (for the specified channel), support PCM, AAC format data.
SendCustomAudioCaptureAACData Sends AAC audio data produced by custom audio capture to the SDK (for the specified channel).
SendCustomAudioCapturePCMData Sends PCM audio data produced by custom audio capture to the SDK (for the specified channel).
FetchCustomAudioRenderPCMData Fetches PCM audio data of the remote stream from the SDK for custom audio rendering.
OnCapturedAudioData The callback for obtaining the audio data captured by the local microphone.
OnPlaybackAudioData The callback for obtaining the audio data of all the streams playback by SDK.
OnMixedAudioData Callback to get the audio data played by the SDK and the audio data captured by the local microphone. The audio data is the data mixed by the SDK.
OnPlayerAudioData The callback for obtaining the audio data of each stream.

utilities

Method Description
GetNetworkTimeInfo Obtain synchronization network time information.
OnNetworkQuality The network quality callback of users who are publishing in the room.
OnNetworkTimeSynchronized Successful callback of network time synchronization.

rangeAudio

Method Description
CreateRangeAudio Creates a range audio instance.
DestroyRangeAudio Destroys a range audio instance.
SetAudioReceiveRange Set the maximum range of received audio.
SetRangeAudioVolume Set range voice volume.
UpdateSelfPosition Update self position and orentation.
UpdateAudioSource Add or update audio source position information.
EnableSpatializer Turn the 3D spatial sound on or off.
EnableMicrophone Turn the microphone on or off.
EnableSpeaker Turn the speaker on or off.
SetRangeAudioMode Set range audio mode.
SetRangeAudioCustomMode Set range audio custom mode.
SetTeamID Set team ID.
MuteUser Whether can receive the audio data of the specified user.
OnRangeAudioMicrophoneStateUpdate Range audio microphone state callback.

CopyrightedMusic

Method Description
CreateCopyrightedMusic Creates a copyrighted music instance.
DestroyCopyrightedMusic Destroys a copyrighted music instance.
InitCopyrightedMusic Initialize the copyrighted music module.
GetCacheSize Get cache size.
ClearCache Clear cache.
SendExtendedRequest Send extended feature request.
GetLrcLyric Get lyrics in lrc format.
GetKrcLyricByToken Get lyrics in krc format.
RequestResource Request music resource.
GetSharedResource Get shared music resource.
Download Download song or accompaniment.
QueryCache Query the resource's cache is existed or not.
GetDuration Get the playing time of a song or accompaniment file.
StartScore Start scoring.
PauseScore Pause scoring.
ResumeScore Resume scoring.
StopScore Stop scoring.
ResetScore Reset scoring.
GetPreviousScore Get the score of the previous sentence.
GetAverageScore Get average score.
GetTotalScore Get total score .
GetFullScore Get full score .
GetStandardPitch Get standard pitch data.
GetCurrentPitch Get real-time pitch data.
OnDownloadProgressUpdate Callback for download song or accompaniment progress rate.
OnCurrentPitchValueUpdate Real-time pitch line callback.

deprecated_api

Method Description
EnableBeautify [Deprecated] Enables or disables the beauty features for the specified publish channel. Deprecated since 2.16.0, please use the [enableEffectsBeauty] function instead.
SetBeautifyOption [Deprecated] Set beautify option. Deprecated since 2.16.0, please use the [setEffectsBeautyParam] function instead.
CreateEngine [Deprecated] Create ZegoExpressEngine singleton object and initialize SDK. Deprecated since 2.14.0, please use the method with the same name without [isTestEnv] parameter instead. Please refer to Testing environment deprecation for more details.
RequestSong [Deprecated] Request a song. Deprecated since 3.0.2, please use the [requestResource] function instead.
RequestAccompaniment [Deprecated] Request accompaniment. Deprecated since 3.0.2, please use the [requestResource] function instead.
RequestAccompanimentClip [Deprecated] Request accompaniment clip. Deprecated since 3.0.2, please use the [requestResource] function instead.
GetMusicByToken [Deprecated] Get a song or accompaniment. Deprecated since 3.0.2, please use the [getSharedResource] function instead.
GetLrcLyric [Deprecated] Get lyrics in lrc format. Deprecated since 3.2.1, please use the method with the same name with [vendorID] parameter instead.
QueryCache [Deprecated] Query the resource's cache is existed or not. Deprecated since 3.2.1, please use the method with the same name with [vendorID] parameter instead.
Page Directory
  • Free trial
  • 提交工单
    咨询集成、功能及报价等问题
    电话咨询
    400 1006 604
    Get Consulting
    Scan Wechat QR code