API Overview

Agora provides ensured quality of experience (QoE) for worldwide Internet-based voice and video communications through SD-RTN™.

Channel management

Method Description
Initialize Initializes IRtcEngine.
Dispose Releases the IRtcEngine instance.
SetChannelProfile Sets the channel profile.
JoinChannel [2/2] Joins a channel with media options.
UpdateChannelMediaOptions Updates the channel media options after joining the channel.
LeaveChannel [1/2] Leaves a channel.
LeaveChannel [2/2] Leaves a channel.
RenewToken Gets a new token when the current token expires after a period of time.
SetClientRole [1/2] Sets the client role.
GetConnectionState Gets the current connection state of the SDK.

Channel events

Event Description
OnJoinChannelSuccess Occurs when a user joins a channel.
OnRejoinChannelSuccess Occurs when a user rejoins the channel.
OnClientRoleChanged Occurs when the user role switches in the interactive live streaming.
OnClientRoleChangeFailed Occurs when the user role switch fails in the interactive live streaming.
OnLeaveChannel Occurs when a user leaves a channel.
OnUserJoined Occurs when a remote user (COMMUNICATION)/ host (LIVE_BROADCASTING) joins the channel.
OnUserOffline Occurs when a remote user (in the communication profile)/ host (in the live streaming profile) leaves the channel.
OnNetworkTypeChanged Occurs when the local network type changes.
OnUplinkNetworkInfoUpdated Occurs when the uplink network information changes.
OnConnectionLost Occurs when the SDK cannot reconnect to Agora's edge server 10 seconds after its connection to the server is interrupted.
OnConnectionStateChanged Occurs when the network connection state changes.
OnRequestToken Occurs when the token expires.
OnTokenPrivilegeWillExpire Occurs when the token expires in 30 seconds.
OnError Reports an error during SDK runtime.

Audio management

Method Description
EnableAudio Enables the audio module.
DisableAudio Disables the audio module.
SetAudioProfile [1/2] Sets the audio profile and audio scenario.
SetAudioScenario Sets audio scenarios.
AdjustRecordingSignalVolume Adjusts the capturing signal volume.
AdjustUserPlaybackSignalVolume Adjusts the playback signal volume of a specified remote user.
AdjustPlaybackSignalVolume Adjusts the playback signal volume of all remote users.
AdjustCustomAudioPublishVolume Adjusts the volume of the custom external audio source when it is published in the channel.
EnableLocalAudio Enables/Disables the local audio capture.

Video management

Method Description
EnableVideo Enables the video module.
DisableVideo Disables the video module.
SetForUser Sets the local or remote video display.
SetVideoEncoderConfiguration Sets the video encoder configuration.
StartPreview [1/2] Enables the local video preview.
StopPreview [1/2] Stops the local video preview.
SetLocalRenderMode [2/2] Updates the display mode of the local video view.
SetRemoteRenderMode Updates the display mode of the video view of a remote user.
EnableLocalVideo Enables/Disables the local video capture.
MuteLocalVideoStream Stops or resumes publishing the local video stream.
MuteRemoteVideoStream Cancels or resumes subscribing to the specified remote user's video stream.
MuteAllRemoteVideoStreams Stops or resumes subscribing to the video streams of all remote users.

Capture screenshots

Method Description
takeSnapshot Takes a snapshot of a video stream.

Video content moderation

Method Description
enableContentInspect Enables/Disables video content moderation.
Event Description
onContentInspectResult Reports the result of video content moderation.

Video content moderation

Method Description
enableContentInspect Enables/Disables video content moderation.
Event Description
onContentInspectResult Reports the result of video content moderation.

Subscribing to and publishing audio and video streams

Method Description
SetSubscribeAudioBlacklist Set the blocklist of subscriptions for audio streams.
SetSubscribeAudioWhitelist Sets the allowlist of subscriptions for audio streams.
SetSubscribeVideoBlacklist Set the bocklist of subscriptions for video streams.
SetSubscribeVideoWhitelist Set the allowlist of subscriptions for video streams.
MuteLocalAudioStream Stops or resumes publishing the local audio stream.
MuteRemoteAudioStream Cancels or resumes subscribing to the specified remote user's audio stream.
MuteAllRemoteAudioStreams Stops or resumes subscribing to the audio streams of all remote users.
EnableLocalVideo Enables/Disables the local video capture.
MuteLocalVideoStream Stops or resumes publishing the local video stream.
MuteRemoteVideoStream Cancels or resumes subscribing to the specified remote user's video stream.
MuteAllRemoteVideoStreams Stops or resumes subscribing to the video streams of all remote users.

Media player

Method Description
CreateMediaPlayer
Dispose Releases all the resources occupied by the media player.
GetMediaPlayerCacheManager Gets an IMediaPlayerCacheManager instance.
IMediaPlayer This class provides media player functions and supports multiple instances.
IMediaPlayerCacheManager This class provides methods to manage cached media files.
IMediaPlayerSourceObserver Provides callbacks for media players.

Local media events

Event Description
OnLocalAudioStateChanged Occurs when the local audio stream state changes.
OnLocalVideoStateChanged Occurs when the local video stream state changes.
OnFirstLocalAudioFramePublished Occurs when the first audio frame is published.
OnFirstLocalVideoFramePublished Occurs when the first video frame is published.
OnAudioPublishStateChanged Occurs when the audio publishing state changes.
OnVideoPublishStateChanged Occurs when the video publishing state changes.

Remote media events

Event Description
OnRemoteAudioStateChanged Occurs when the remote audio state changes.
OnRemoteVideoStateChanged Occurs when the remote video stream state changes.
OnFirstRemoteVideoFrame Occurs when the renderer receives the first frame of the remote video.
OnFirstRemoteVideoDecoded Occurs when the first remote video frame is received and decoded.
OnAudioSubscribeStateChanged Occurs when the audio subscribing state changes.
OnVideoSubscribeStateChanged Occurs when the video subscribing state changes.
OnUserMuteAudio Occurs when a remote user (in the communication profile) or a host (in the live streaming profile) stops/resumes sending the audio stream.
OnUserMuteVideo Occurs when a remote user stops/resumes publishing the video stream.
OnUserEnableVideo Occurs when a remote user enables/disables the video module.
OnUserEnableLocalVideo Occurs when a specific remote user enables/disables the local video capturing function.

Statistics events

Event Description
OnRtcStats Reports the statistics of the current call.
OnNetworkQuality Reports the last mile network quality of each user in the channel.
OnLocalAudioStats Reports the statistics of the local audio stream.
OnLocalVideoStats Reports the statistics of the local video stream.
OnRemoteAudioStats Reports the statistics of the audio stream sent by each remote users.
OnRemoteVideoStats Reports the statistics of the video stream sent by each remote users.

Video pre-process and post-process

Method Description
SetBeautyEffectOptions Sets the image enhancement options.
EnableVirtualBackground Enables/Disables the virtual background.
SetColorEnhanceOptions Sets color enhancement.
SetLowlightEnhanceOptions Sets low-light enhancement.
SetVideoDenoiserOptions Sets video noise reduction.

In-ear monitoring

Attention:

This method is for Android and iOS only.

Method Description
EnableInEarMonitoring Enables in-ear monitoring.
SetInEarMonitoringVolume Sets the volume of the in-ear monitor.

Music file playback and mixing

Method Description
StartAudioMixing [1/2] Starts playing the music file.
StopAudioMixing Stops playing and mixing the music file.
PauseAudioMixing Pauses playing the music file.
ResumeAudioMixing Resumes playing and mixing the music file.
AdjustAudioMixingVolume Adjusts the volume during audio mixing.
AdjustAudioMixingPlayoutVolume Adjusts the volume of audio mixing for local playback.
AdjustAudioMixingPublishVolume Adjusts the volume of audio mixing for publishing.
GetAudioMixingPlayoutVolume Retrieves the audio mixing volume for local playback.
GetAudioMixingPublishVolume Retrieves the audio mixing volume for publishing.
GetAudioMixingDuration Retrieves the duration (ms) of the music file.
GetAudioMixingCurrentPosition Retrieves the playback position (ms) of the music file.
SetAudioMixingPitch Sets the pitch of the local music file.
SetAudioMixingPosition Sets the audio mixing position.
SetAudioMixingDualMonoMode Sets the channel mode of the current audio file.
Event Description
OnAudioMixingStateChanged Occurs when the playback state of the music file changes.

Audio effect file playback

Method Description
GetEffectsVolume Retrieves the volume of the audio effects.
SetEffectsVolume Sets the volume of the audio effects.
GetVolumeOfEffect Gets the volume of a specified audio effect.
SetVolumeOfEffect Sets the volume of a specified audio effect.
PreloadEffect Preloads a specified audio effect file into the memory.
PlayEffect Plays the specified local or online sound effect file.
PauseEffect Pauses playing a specified audio effect file.
PauseAllEffects Pauses playing all audio effect files.
ResumeEffect Resumes playing a specified audio effect.
ResumeAllEffects Resumes playing all audio effects.
StopEffect Stops playing a specified audio effect.
StopAllEffects Stops playing all audio effects.
UnloadEffect Releases a specified preloaded audio effect from the memory.
UnloadAllEffects Releases a specified preloaded audio effect from the memory.
GetEffectDuration Retrieves the duration of the audio effect file.
GetEffectCurrentPosition Retrieves the playback position of the audio effect file.
SetEffectPosition Sets the playback position of an audio effect file.

Virtual metronome

Attention:

This method is for Android and iOS only.

Method Description
StartRhythmPlayer Enables the virtual metronome.
StopRhythmPlayer Disables the virtual metronome.
ConfigRhythmPlayer Configures the virtual metronome.

Voice changer and reverberation

Method Description
SetLocalVoiceEqualization Sets the local voice equalization effect.
SetLocalVoicePitch Changes the voice pitch of the local speaker.
SetLocalVoiceReverb Sets the local voice reverberation.
SetVoiceBeautifierPreset Sets a preset voice beautifier effect.
SetVoiceBeautifierParameters Sets parameters for the preset voice beautifier effects.
SetAudioEffectPreset Sets an SDK preset audio effect.
SetAudioEffectParameters Sets parameters for SDK preset audio effects.
SetVoiceConversionPreset Sets a preset voice beautifier effect.

Pre-call network test

Method Description
StartEchoTest [2/2] Starts an audio call test.
StopEchoTest Stops the audio call test.
StartLastmileProbeTest Starts the last mile network probe test.
StopLastmileProbeTest Stops the last mile network probe test.
Event Description
OnLastmileQuality Reports the last-mile network quality of the local user.
OnLastmileProbeResult Reports the last mile network probe result.

Screen share API

Method Description
GetScreenCaptureSources Gets a list of shareable screens and windows. (For Windows and macOS only)
StartScreenCaptureByWindowId Shares the whole or part of a window by specifying the window ID. (For Windows and macOS only)
StartScreenCaptureByScreenRect Shares the whole or part of a screen by specifying the screen rect. (For Windows only)
StartScreenCaptureByDisplayId Shares the screen by specifying the display ID. (For Windows and macOS only)
SetScreenCaptureContentHint Sets the content hint for screen sharing.
UpdateScreenCaptureRegion Updates the screen sharing region. (For Windows and macOS only)
StartScreenCapture Starts screen sharing.(For Android and iOS only)
UpdateScreenCapture Updates the screen sharing parameters.(For Android and iOS only)
UpdateScreenCaptureParameters Updates the screen sharing parameters. (For Windows and macOS only)
StopScreenCapture Stops screen sharing.
SetScreenCaptureScenario Sets the screen sharing scenario. (For Windows and macOS only)

Video dual stream

Method Description
EnableDualStreamMode [3/3] Enables/Disables dual-stream mode.
SetRemoteVideoStreamType Sets the stream type of the remote video.
SetRemoteDefaultVideoStreamType Sets the default stream type of subscrption for remote video streams.

Watermark

Method Description
AddVideoWatermark [2/2] Adds a watermark image to the local video.
ClearVideoWatermarks Removes the watermark image from the video stream.

Encryption

Method Description
EnableEncryption Enables/Disables the built-in encryption.
Event Description
OnEncryptionError Reports the built-in encryption errors.

Sound localization

Method Description
EnableSoundPositionIndication Enables/Disables stereo panning for remote users.
SetRemoteVoicePosition Sets the 2D position (the position on the horizontal plane) of the remote user's voice.

Spatial audio effect

Attention:

This function has not reached GA, if you want to enable it, please contact support@agora.io, if you need technical support, please contact contact technical support.

Local Cartesian coordinate system calculation solution Description
GetLocalSpatialAudioEngine Gets one ILocalSpatialAudioEngine object.
Initialize Initializes ILocalSpatialAudioEngine.
Dispose Destroys ILocalSpatialAudioEngine.
UpdateSelfPosition Updates the spatial position of the local user.
UpdateRemotePosition Updates the spatial position of the specified remote user.
RemoveRemotePosition Removes the spatial position of the specified remote user.
ClearRemotePositions Removes the spatial positions of all remote users.

Channel media stream relay

Method Description
StartChannelMediaRelay Starts relaying media streams across channels. This method can be used to implement scenarios such as co-host across channels.
UpdateChannelMediaRelay Updates the channels for media stream relay.
StopChannelMediaRelay Stops the media stream relay. Once the relay stops, the host quits all the destination channels.
PauseAllChannelMediaRelay Pauses the media stream relay to all destination channels.
ResumeAllChannelMediaRelay Resumes the media stream relay to all destination channels.
Event Description
OnChannelMediaRelayStateChanged Occurs when the state of the media stream relay changes.
OnChannelMediaRelayEvent Reports events during the media stream relay.

Custom audio source

Method Description
SetExternalAudioSource Sets the external audio source parameters.
pushAudioFrame Pushes the external audio frame.

Custom audio renderer

Method Description
SetExternalAudioSink Sets the external audio sink.
PullAudioFrame Pulls the remote audio data.

Raw audio data

Method Description
RegisterAudioFrameObserver Registers an audio frame observer object.
SetRecordingAudioFrameParameters Sets the format of the captured raw audio data.
SetPlaybackAudioFrameParameters Sets the audio data format for playback.
SetMixedAudioFrameParameters Sets the audio data format reported by OnMixedAudioFrame.
SetPlaybackAudioFrameBeforeMixingParameters Sets the audio data format reported by OnPlaybackAudioFrameBeforeMixing [1/2].
Event Description
OnRecordAudioFrame Gets the captured audio frame.
OnPlaybackAudioFrame Gets the audio frame for playback.
OnPlaybackAudioFrameBeforeMixing [1/2] Retrieves the audio frame of a specified user before mixing.
OnMixedAudioFrame Retrieves the mixed captured and playback audio frame.

Encoded audio data

Method Description
RegisterAudioEncodedFrameObserver Registers an encoded audio observer.
Event Description
OnRecordAudioEncodedFrame Gets the encoded audio data of the local user.
OnPlaybackAudioEncodedFrame Gets the encoded audio data of all remote users.
OnMixedAudioEncodedFrame Gets the mixed and encoded audio data of the local and all remote users.

Custom video source

Method Description
createCustomVideoTrack Creates a customized video track.
destroyCustomVideoTrack Destroys the specified video track.

External video source

Method Description
SetExternalVideoSource Configures the external video source.
PushVideoFrame Pushes the external raw video frame to the SDK.

Raw video data

Method Description
RegisterVideoFrameObserver Registers a video frame observer object.
Event Description
OnCaptureVideoFrame Occurs each time the SDK receives a video frame captured by the local camera.
OnPreEncodeVideoFrame Occurs each time the SDK receives a video frame before encoding.
OnRenderVideoFrame Occurs each time the SDK receives a video frame sent by the remote user.
GetObservedFramePosition Sets the frame position for the video observer.
GetVideoFormatPreference Sets the format of the raw video data output by the SDK.

Encoded video data

Method Description
RegisterVideoEncodedFrameObserver Registers a receiver object for the encoded video image.
Event Description
OnEncodedVideoFrameReceived Occurs each time the SDK receives an encoded video image.

Extension

Method Description
EnableExtension Enables/Disables extensions.
SetExtensionProperty Sets the properties of the extension.
SetExtensionProviderProperty Sets the properties of the extension provider.
GetExtensionProperty Gets detailed information of the extension.
Event Description
OnExtensionEvent The event callback of the extension.
OnExtensionStarted Occurs when the extension is enabled.
OnExtensionStopped Occurs when the extension is disabled.

Audio recording

Method Description
StartAudioRecording [3/3] Starts the audio recording on the client.
StopAudioRecording Stops the audio recording on the client.

Local audio and video recording

Method Description
SetMediaRecorderObserver Registers one IMediaRecorderObserver object.
StartRecording Starts recording the local audio and video.
StopRecording Stops recording the local audio and video.
Event Description
OnRecorderStateChanged Occurs when the recording state changes.
OnRecorderInfoUpdated OnRecorderInfoUpdated

Multiple channels

Method Description
CreateAgoraRtcEngineEx Creates an IRtcEngineEx object.
JoinChannelEx Joins a channel with the connection ID.
LeaveChannelEx Leaves a channel.

Audio route

Method Description
SetDefaultAudioRouteToSpeakerphone Sets the default audio playback route.
SetEnableSpeakerphone Enables/Disables the audio route to the speakerphone.
IsSpeakerphoneEnabled Checks whether the speakerphone is enabled.
Event Description
OnAudioRoutingChanged Occurs when the local audio route changes.

Volume indication

Method Description
EnableAudioVolumeIndication Enables the reporting of users' volume indication.
Event Description
OnAudioVolumeIndication Reports the volume information of users.
OnActiveSpeaker Occurs when the most active remote speaker is detected.

Data stream

Method Description
CreateDataStream [2/2] Creates a data stream.
SendStreamMessage Sends data stream messages.
Event Description
OnStreamMessage Occurs when the local user receives the data stream from the remote user.
OnStreamMessageError Occurs when the local user does not receive the data stream from the remote user.

Video device management

Attention:

This group of methods is for Windows only.

Method Description
EnumerateVideoDevices Enumerates the video devices.
SetDevice Specifies the video capture device with the device ID.
GetDevice Retrieves the current video capture device.
NumberOfCapabilities Gets the number of video formats supported by the specified video capture device.
GetCapability Gets the detailed video frame information of the video capture device in the specified video format.

Audio device management

Method Description
EnumeratePlaybackDevices Enumerates the audio playback devices. (For Windows only)
EnumerateRecordingDevices Enumerates the audio capture devices. (For Windows only)
FollowSystemPlaybackDevice Sets the audio playback device used by the SDK to follow the system default audio playback device. (For Windows and macOS only)
FollowSystemRecordingDevice Sets the audio recording device used by the SDK to follow the system default audio recording device. (For Windows and macOS only)
SetPlaybackDevice Sets the audio playback device. (For Windows only)
GetPlaybackDevice Retrieves the audio playback device associated with the device ID. (For Windows only)
GetPlaybackDeviceInfo Retrieves the audio playback device associated with the device ID. (For Windows only)
SetRecordingDevice Sets the audio recording device. (For Windows only)
GetRecordingDevice Gets the current audio recording device. (For Windows only)
GetRecordingDeviceInfo Retrieves the volume of the audio recording device. (For Windows only)
StartPlaybackDeviceTest Starts the audio playback device test. (For Windows and macOS only)
StopPlaybackDeviceTest Stops the audio playback device test. (For Windows and macOS only)
StartRecordingDeviceTest Starts the audio recording device test. (For Windows and macOS only)
StopRecordingDeviceTest Stops the audio capture device test. (For Windows and macOS only)
StartAudioDeviceLoopbackTest Starts an audio device loopback test. (For Windows and macOS only)
StopAudioDeviceLoopbackTest Stops the audio device loopback test. (For Windows and macOS only)
Event Description
OnAudioDeviceStateChanged Occurs when the audio device state changes. (For Windows and macOS only)

Miscellaneous audio control

Attention:

This method is for Windows and macOS only.

Method Description
EnableLoopbackRecording Enables loopback audio capture.

Miscellaneous methods

Method Description
SendCustomReportMessageEx Agora supports reporting and analyzing customized messages.
SetEnable Sets whether to enable the video rendering.
GetCallId Retrieves the 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.
GetVersion Gets the SDK version.
EnableVideoImageSource Sets whether to replace the current video feeds with images when publishing video streams.

Miscellaneous events

Event Description
OnApiCallExecuted Occurs when a method is executed by the SDK.
OnProxyConnected Reports the proxy connection state.