Agora provides ensured quality of experience (QoE) for worldwide Internet-based voice and video communications through a virtual global network optimized for real-time web and mobile-to-mobile applications.

The RtcEngine Class

Core Methods

Core methods for creating an RTC engine and setting up a basic communication channel. This group of methods is applicable to Voice Communication, Video Communication, and Interactive Broadcast.

Method Description
create Creates an RtcEngine instance.
destroy Destroys the RtcEngine instance.
setChannelProfile Sets the channel profile.
setClientRole Sets the user role (Live Broadcast only).
joinChannel Allows a user to join a channel.
leaveChannel Allows a user to leave a channel.
renewToken Renews the Token.
enableWebSdkInteroperability Enables interoperability with the Agora Web SDK (Live Broadcast only).

Core Audio

This group of methods is applicable to Voice Communication, Video Communication, and Interactive Broadcast.

Method Description
enableAudio Enables the audio module.
disableAudio Disables the audio module.
setAudioProfile Sets the audio parameters and application scenarios.
adjustRecordingSignalVolume Adjusts the recording volume.
adjustPlaybackSignalVolume Adjusts the playback volume.
enableAudioVolumeIndication Enables the onAudioVolumeIndication callback at a set time interval to report on which user is speaking and the speaker's volume.
enableLocalAudio Enables/disables the local audio capture.
muteLocalAudioStream Sends/Stops sending the local audio stream.
muteRemoteAudioStream Receives/Stops receiving a specified audio stream.
muteAllRemoteAudioStreams Receives/Stops receiving all the audio streams.
setDefaultMuteAllRemoteAudioStreams Sets whether to receive the audio streams by default.

Core Video

This group of methods is applicable to Video Communication, and Interactive Broadcast.

Method Description
enableVideo Enables the video module.
disableVideo Disables the video module.
setVideoEncoderConfiguration Sets the video encoder configuration.
setupLocalVideo Sets the local video view.
setupRemoteVideo Sets the remote user's video view.
setLocalRenderMode Sets the local video display mode.
setRemoteRenderMode Sets the remote video display mode.
CreateRendererView Creates the video renderer view.
startPreview Starts the local video preview.
stopPreview Stops the local video preview.
enableLocalVideo Enables/Disables the local video capture.
muteLocalVideoStream Sends/Stops sending the local video stream.
muteRemoteVideoStream Receives/Stops receiving a specified remote video stream.
muteAllRemoteVideoStreams Receives/Stops receiving all the video streams.
setDefaultMuteAllRemoteVideoStreams Sets whether to receive the video streams by default.

Audio Routing Controller

Method Description
setDefaultAudioRouteToSpeaker Sets the default audio playback route.
setEnableSpeakerphone Enables/Disables the audio playback routing to the speakerphone.
isSpeakerphoneEnabled Checks whether the speakerphone is enabled.

In-ear Monitor

This group of methods is applicable to Voice Communication, Video Communication, and Interactive Broadcast.

Method Description
enableInEarMonitoring Enables in-ear monitoring.
setInEarMonitoringVolume Sets the volume of the in-ear monitor.

Audio Sound Effect

This group of methods is applicable to Voice Communication, Video Communication, and Interactive Broadcast.

Method Description
setLocalVoicePitch Changes the voice pitch of the local speaker.
setLocalVoiceEqualization Sets the local voice equalization effect.
setLocalVoiceReverb Sets the local voice reverberation.

Music File Playback and Mixing

This group of methods is applicable to Voice Communication, Video Communication, and Interactive Broadcast.

Method Description
startAudioMixing Starts playing and mixing the music file.
stopAudioMixing Stops playing or mixing the music file.
pauseAudioMixing Pauses playing and mixing the music file.
resumeAudioMixing Resumes playing and mixing the music file.
adjustAudioMixingVolume Adjusts the volume during audio mixing.
getAudioMixingDuration Gets the duration (ms) of the music file.
getAudioMixingCurrentPosition Gets the playback position (ms) of the music file.
setAudioMixingPosition Sets the playback position (ms) of the music file.

Audio Effect File Playback

This group of methods is applicable to Voice Communication, Video Communication, and Interactive Broadcast.

Method Description
getAudioEffectManager Gets the IAudioEffectManager class to manage the audio effect files.
getEffectsVolume Gets the volume of the audio effects.
setEffectsVolume Sets the volume of the audio effects.
setVolumeOfEffect Sets the volume of a specified audio effect.
playEffect Plays a specified audio effect.
stopEffect Stops playing a specified audio effect.
stopAllEffects Stops playing all audio effects.
preloadEffect Preloads a specified audio effect file into the memory.
unloadEffect Releases a specified preloaded audio effect from the memory.
pauseEffect Pauses a specified audio effect.
pauseAllEffects Pauses all audio effects.
resumeEffect Resumes playing a specified audio effect.
resumeAllEffects Resumes playing all audio effects.

Audio Recorder

This group of methods is applicable to Voice Communication, Video Communication, and Interactive Broadcast.

Method Description
startAudioRecording Starts an audio recording on the client.
stopAudioRecording Stops the audio recording on the client.

Loopback Recording

  • N/A

Network-related Test

This group of methods is applicable to Voice Communication, Video Communication, and Interactive Broadcast.

Method Description
startEchoTest Starts an audio call test.
stopEchoTest Stops the audio call test.
enableLastmileTest Enables the network connection quality test.
disableLastmileTest Disables the network connection quality test.

Custom Video Module

This group of methods is applicable to Video Communication, and Interactive Broadcast.

Method Description
setVideoSource Customizes the video source.
setLocalVideoRenderer Customizes the local video renderer.
setRemoteVideoRenderer Customizes the remote video renderer.

External Audio Data (Push-mode Only)

This group of methods is applicable to Voice Communication, Video Communication, and Interactive Broadcast.

Method Description
setExternalAudioSource Configures the external audio source.
pushExternalAudioFrame Pushes the external audio frame.

External Video Data (Push-mode Only)

This group of methods is applicable to Video Communication and Interactive Broadcast.

Method Description
setExternalVideoSource Configures the external video source.
pushExternalVideoFrame Pushes the external video frame.
isTextureEncodeSupported Checks if textured video frame is supported.

Raw Audio Data

This group of methods is applicable to Voice Communication, Video Communication, and Interactive Broadcast. See Modify Raw Data for details.

Method Description
registerAudioFrameObserver Registers an audio frame observer object.
setRecordingAudioFrameParameters Sets the audio recording format for the onRecordFrame callback.
setPlaybackAudioFrameParameters Sets the audio playback format for the onPlaybackFrame callback.
setMixedAudioFrameParameters Sets the mixed audio format.

Raw Video Data

  • N/A

Watermark

This group of methods is applicable only to Interactive Broadcast.

Method Description
addVideoWatermark Adds a watermark image to the local video.
clearVideoWatermark Removes the added watermark image from the video stream.

Stream Fallback

This group of methods is applicable only to Interactive Broadcast.

Method Description
setLocalPublishFallbackOption Sets the fallback option for the published video stream under unreliable network conditions.
setRemoteSubscribeFallbackOption Sets the fallback option for the remote video stream under unreliable network conditions.

Dual-stream Mode

This group of methods is applicable to Video Communication, and Interactive Broadcast.

Method Description
enableDualStreamMode Enables/disables the dual-stream mode.
setRemoteVideoStreamType Sets the video stream type of the subscribed stream.
setRemoteDefaultVideoStreamType Sets the default video stream type of the subscribed stream.

Encryption

This group of methods is applicable to Voice Communication, Video Communication, and Interactive Broadcast.

Method Description
setEncryptionSecret Enables built-in encryption with an encryption password before joining a channel.
setEncryptionMode Sets the built-in encryption mode.

Inject an Online Media Stream

This group of methods is applicable only to Interactive Broadcast.

Method Description
addInjectStreamUrl Injects an online media stream to a live broadcast.
removeInjectStreamUrl Removes the injected online media stream from a live broadcast.

CDN Live Streaming

This group of methods is applicable only to Interactive Broadcast.

Method Description
addPublishStreamUrl Adds a CDN stream address.
removePublishStreamUrl Removes a CDN stream address.
setLiveTranscoding Sets the video layout and audio settings for CDN live.

Data Stream

This group of methods is applicable to Video Communication, and Interactive Broadcast.

Method Description
createDataStream Creates a data stream.
sendStreamMessage Sends data stream messages.

Miscellaneous Video Control

This group of methods is applicable to Video Communication, and Interactive Broadcast.

Method Description
setVideoQualityParameters Sets the preference option for the video quality (Live broadcast only).
setLocalVideoMirrorMode Sets the local video mirror mode.

Screen Sharing

  • N/A

Camera Control

Method Description
switchCamera Switches between the front and rear camera.
isCameraZoomSupported Checks whether the camera zoom function is supported.
isCameraTorchSupported Checks whether the camera flash function is supported.
isCameraFocusSupported Check whether the camera manual focus function is supported.
isCameraAutoFocusFaceModeSupported Check whether the camera face auto-focus function is supported.
setCameraZoomFactor Sets the camera zoom ratio.
getCameraMaxZoomFactor Gets the maximum zoom ratio of the camera.
setCameraFocusPositionInPreview Sets the camera manual focus position.
setCameraTorchOn Enables the camera flash function.
setCameraAutoFocusFaceModeEnabled Enables the camera auto-face focus function.

Device Manager

  • N/A

Miscellaneous Methods

This group of methods is applicable to Voice Communication, Video Communication, and Interactive Broadcast.

Method Description
getCallId Gets the current call ID.
rate Allows a user to rate a call after the call ends.
complain Allows a user to complain about the call quality after a call ends.
getSdkVersion Gets the SDK version number.
getErrorDescription Gets the warning or error description.
setLogFile Specifies an SDK output log file.
setLogFilter Sets the output log level of the SDK.
getNativeHandle Gets the native handle of the SDK engine.
addHandler Adds the IRtcEngineEventHandler class.

Customized Methods

This group of methods is applicable to Voice Communication, Video Communication, and Interactive Broadcast.

Method Description
setParameters Provides technical preview functionalities or special customizations by configuring the SDK with JSON options.
getParameter Gets the Agora SDK’s parameters for customization purposes.

The IRtcEngineEventHandler Class

Core Events

Callback Description
onWarning Occurs when a warning occurs.
onError Occurs when an error occurs.
onJoinChannelSuccess Occurs when a user joins a channel.
onRejoinChannelSuccess Occurs when a user rejoins the channel.
onLeaveChannel Occurs when a user leaves the channel.
onClientRoleChanged Occurs when the user role in a live broadcast is changed.
onUserJoined Occurs when a remote user joins the channel.
onUserOffline Occurs when a remote user leaves the channel or goes offline.
onConnectionInterrupted Occurs when the connection between the SDK and the server is interrupted.
onConnectionLost Occurs when the connection between the SDK and the server is lost.
onConnectionBanned Occurs when your connection is banned by the Agora Server.
onApiCallExecuted Occurs when an API method is executed.
onTokenPrivilegeWillExpire Occurs when the token expires in 30 seconds.
onRequestToken Occurs when the token expires.

Media Events

Callback Description
onMicrophoneEnabled Occurs when the state of the microphone is changed.
onAudioVolumeIndication Reports which user is speaking and the speaker's volume.
onActiveSpeaker Reports which user is speaking in the channel.
onFirstLocalAudioFrame Occurs when the first local audio frame is sent.
onFirstRemoteAudioFrame Occurs when the first remote audio frame is received.
onVideoStopped Occurs when the video stops playing.
onFirstLocalVideoFrame Occurs when the first local video frame is sent.
onFirstRemoteVideoDecoded Occurs when the first remote video frame is decoded.
onFirstRemoteVideoFrame Occurs when the first remote video frame is rendered.
onUserMuteAudio Occurs when a remote user's audio stream is muted/unmuted.
onUserMuteVideo Occurs when a remote user's video stream palyback pauses/resumes.
onUserEnableVideo Occurs when a remote user enables/disables the video module.
onUserEnableLocalVideo Occurs when a remote user enables/disables the local video capture.
onVideoSizeChanged Occurs when the video size or rotation information of a specified remote user is changed.
onRemoteVideoStateChanged Occurs when the remote video stream state is changed.

Fallback Events

Callback Description
onLocalPublishFallbackToAudioOnly Occurs when the published media stream falls back to an audio-only stream due to poor network conditions or switches back to video stream after the network conditions improve.
onRemoteSubscribeFallbackToAudioOnly Occurs when the subscribed media stream falls back to audio-only stream due to poor network conditions or switches back to video stream after the network conditions improve.

Device Events

Callback Description
onAudioRouteChanged Occurs when the local audio playback route changes.
onCameraReady Occurs when the camera is turned on and ready to capture video.
onCameraFocusAreaChanged Occurs when the camera focus area changes.

Statistics Events

Callback Description
onAudioQuality Reports the audio quality of the current call once every two seconds.
onRtcStats Reports the statistics of the RtcEngine once every two seconds.
onLastmileQuality Reports the last mile network quality of the local user once every two seconds.
onNetworkQuality Reports the network quality of each user once every two seconds.
onLocalVideoStats Reports the statistics of the uploading local video streams once every two seconds.
onRemoteVideoStats Reports the statistics of the receiving remote video streams once every two seconds.
onRemoteAudioTransportStats Reports the statistics of the remote audio transmission once every two seconds.
onRemoteVideoTransportStats Reports the statistics of the remote video transmission once every two seconds.

Audio Player Events

Callback Description
onAudioMixingFinished Occurs when the audio mixing file playback finishes.
onAudioEffectFinished Occurs when the audio effect file playback finishes.

CDN Live Streaming Events

Callback Description
onStreamPublished Occurs when a CDN live stream is published.
onStreamUnpublished Occurs when a CDN live stream stops.
onTranscodingUpdated Occurs when the publisher's transcoding settings are updated.

Inject Online Media Stream Events

Callback Description
onStreamInjectedStatus Reports the status of the injected online media stream.

Stream Message Events

Callback Description
onStreamMessage Occurs when the local user receives a remote data stream within five seconds.
onStreamMessageError Occurs when the local user fails to receive the remote data stream.

Raw Audio Data Events

Callback Description
onRecordFrame Occurs when the recorded audio frame is received.
onPlaybackFrame Occurs when the playback audio frame is received.

Raw Video Data Events

  • N/A

Miscellaneous Events

Callback Description
onMediaEngineLoadSuccess Occurs when the media engine is loaded.
onMediaEngineStartCallSuccess Occurs when the media engine starts.