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.
During API calls, the SDK may returns error codes and warning codes. See Error Codes and Warning Codes.
Method | Description |
---|---|
GetEngine1 | Initializes the IRtcEngine. |
GetEngine2 | Initializes the IRtcEngine and specifies the connection area. |
Destroy | Destroys all IRtcEngine resources. |
SetChannelProfile | Sets the channel profile of the Agora IRtcEngine. |
SetClientRole1 | Sets the role of the user in interactive live streaming. |
SetClientRole2 | Sets the role and level of the user in interactive live streaming. |
JoinChannelByKey | Allows a user to join a channel with token. |
JoinChannel | Allows a user to join a channel and set the publishing and subscribing states. |
SwitchChannel | Switches to a different channel in interactive live streaming. |
SwitchChannel2 | Switches to a different channel and sets the subscribing state in the interactive live streaming. |
LeaveChannel | Allows a user to leave a channel. |
RenewToken | Renews the Token. |
GetConnectionState | Gets the current connection state of the SDK. |
Event | Description |
---|---|
OnConnectionStateChangedHandler | Occurs when the connection state between the SDK and the server changes. |
OnJoinChannelSuccessHandler | Occurs when a user joins a channel. |
OnReJoinChannelSuccessHandler | Occurs when a user rejoins the channel. |
OnLeaveChannelHandler | Occurs when a user leaves the channel. |
OnClientRoleChangedHandler | Occurs when the user role switches in interactive live streaming. |
OnUserJoinedHandler | Occurs when a remote user (COMMUNICATION )/ host (LIVE_BROADCASTING ) joins the channel. |
OnUserOfflineHandler | Occurs when a remote user (COMMUNICATION )/ host (LIVE_BROADCASTING ) leaves the channel. |
OnNetworkTypeChangedHandler | Occurs when the local network type changes. |
OnConnectionLostHandler | Occurs when the SDK cannot reconnect to Agora's edge server 10 seconds after its connection to the server is interrupted. |
OnTokenPrivilegeWillExpireHandler | Occurs when the token expires in 30 seconds. |
OnRequestTokenHandler | Occurs when the token expires. |
Method | Description |
---|---|
EnableAudio | Enables the audio module. |
DisableAudio | Disables the audio module. |
SetAudioProfile | Sets the audio parameters and application scenarios. |
AdjustRecordingSignalVolume | Adjusts the volume of the signal captured by the microphone. |
AdjustLoopbackRecordingSignalVolume | Adjusts the volume of the signal captured by the sound card. |
AdjustUserPlaybackSignalVolume | Adjusts the playback signal volume of a specified remote user. |
AdjustPlaybackSignalVolume | Adjusts the playback signal volume of all remote users. |
EnableLocalAudio | Enables/Disables the local audio sampling. |
MuteLocalAudioStream | Stops or resumes publishing the local audio stream. |
MuteRemoteAudioStream | Stops or resumes subscribing to the audio stream of a specified user. |
MuteAllRemoteAudioStreams | Stops or resumes subscribing to the audio streams of all remote users. |
Method | Description |
---|---|
EnableAudioVolumeIndication | Enables the OnVolumeIndicationHandler callback at a set time interval to report on which users are speaking and the speakers' volume. |
Event | Description |
---|---|
OnVolumeIndicationHandler | Reports which users are speaking, the speakers' volumes, and whether the local user is speaking. |
OnActiveSpeakerHandler | Reports which user is the loudest speaker. |
Method | Description |
---|---|
EnableFaceDetection | Enables/Disables face detection for the local user. |
Event | Description |
---|---|
OnFacePositionChangedHandler | Reports the face detection result of the local user. |
Method | Description |
---|---|
EnableVideo | Enables the video module. |
EnableVideoObserver | Enables the video observer. |
DisableVideo | Disables the video module. |
DisableVideoObserver | Disables the video observer. |
SetVideoEncoderConfiguration | Sets the video encoder configuration. |
SetForUser | Sets the local/remote video. |
StartPreview | Starts the local video preview before joining the channel. |
StopPreview | Stops the local video preview and disables video. |
EnableLocalVideo | Enables/Disables the local video capture. |
MuteLocalVideoStream | Stops or resumes publishing the local video stream. |
MuteRemoteVideoStream | Stops or resumes subscribing to the video stream of a specified user. |
MuteAllRemoteVideoStreams | Stops or resumes subscribing to the video streams of all remote users. |
Method | Description |
---|---|
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 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. |
GetEffectDuration | Gets the duration of the audio effect file. |
SetEffectPosition | Sets the playback position of an audio effect file. |
GetEffectCurrentPosition | Gets the playback position of the audio effect file. |
SetVoiceOnlyMode | Sets the voice-only mode. |
Event | Description |
---|---|
OnAudioEffectFinishedHandler | Occurs when the local audio effect playback finishes. |
Method | Description |
---|---|
SetVoiceBeautifierPreset | Sets an SDK preset voice beautifier effect. |
SetVoiceBeautifierParameters | Sets parameters for SDK preset voice beautifier effects. |
SetAudioEffectPreset | Sets an SDK preset audio effect. |
SetAudioEffectParameters | Sets parameters for SDK preset audio effects. |
SetVoiceConversionPreset | Sets an SDK preset voice conversion effect. |
SetLocalVoicePitch | Changes the voice pitch of the local speaker. |
SetLocalVoiceEqualization | Sets the local voice equalization effect. |
SetLocalVoiceReverb | Sets the local voice reverberation. |
Method | Description |
---|---|
EnableSoundPositionIndication | Enables/Disables stereo panning for remote users. |
SetRemoteVoicePosition | Sets the sound position and gain of a remote user. |
Method | Description |
---|---|
SetDefaultAudioRouteToSpeakerphone | Sets the default audio playback route. (For Android and iOS only) |
SetEnableSpeakerphone | Enables/Disables the audio playback route to the speakerphone. (For Android and iOS only) |
IsSpeakerphoneEnabled | Checks whether the speakerphone is enabled. (For Android and iOS only) |
Event | Description |
---|---|
OnAudioRouteChangedHandler | Occurs when the local audio route changes. (Android, iOS and macOS only) |
Event | Description |
---|---|
OnLocalAudioStateChangedHandler | Occurs when the local audio state changes. |
OnLocalVideoStateChangedHandler | Occurs when the local video state changes. |
OnFirstLocalAudioFramePublishedHandler | Occurs when the first audio frame is published. |
OnFirstLocalVideoFramePublishedHandler | Occurs when the first video frame is published. |
OnFirstLocalVideoFrameHandler | Occurs when the first local video frame is rendered. |
OnAudioPublishStateChangedHandler | Occurs when the audio publishing state changes. |
OnVideoPublishStateChangedHandler | Occurs when the video publishing state changes. |
Event | Description |
---|---|
OnRemoteAudioStateChangedHandler | Occurs when the remote audio state changes. |
OnRemoteVideoStateChangedHandler | Occurs when the remote video state changes. |
OnFirstRemoteVideoFrameHandler | Occurs when the first remote video frame is rendered. |
OnAudioSubscribeStateChangedHandler | Occurs when the audio subscribing state changes. |
OnVideoSubscribeStateChangedHandler | Occurs when the video subscribing state changes. |
After joining a channel, SDK triggers this group of callbacks once every two seconds.
Event | Description |
---|---|
OnRtcStatsHandler | Reports the statistics of the current call session. |
OnNetworkQualityHandler | Reports the network quality of each user. |
OnLocalAudioStatsHandler | Reports the statistics of the local audio stream. |
OnLocalVideoStatsHandler | Reports the statistics of the local video stream. |
OnRemoteAudioStatsHandler | Reports the statistics of the audio stream from each remote user/host. |
OnRemoteVideoStatsHandler | Reports the statistics of the video stream from each remote user/host. |
Method | Description |
---|---|
SetBeautyEffectOptions | Sets the image enhancement options. (This method applies to Android and iOS only.) |
Method | Description |
---|---|
SetBeautyEffectOptions | Sets the image enhancement options. |
EnableVirtualBackground | Enables/Disables the virtual background. (beta function) |
Event | Description |
---|---|
OnVirtualBackgroundSourceEnabledHandler | Reports whether the virtual background is successfully enabled. (beta function) |
We provide an advanced guide on the applicable scenarios, implementation and considerations for this group of methods. For details, see Join multiple channels.
Method | Description |
---|---|
CreateChannel | Creates and gets an AgoraChannel object. To join multiple channels, create multiple AgoraChannel objects. |
SetMultiChannelWant | Sets whether to enable the multi-channel mode. |
SetForMultiChannelUser | Sets the local or remote video of users in multiple channels. |
AgoraChannel | Provides methods that enable real-time communications in a specified channel. |
This group of methods applies to Windows or macOS only.
Method | Description |
---|---|
StartScreenCaptureByDisplayId | Shares the whole or part of a screen by specifying the display ID. |
StartScreenCaptureByScreenRect | Shares the whole or part of a screen by specifying the screen rect. |
StartScreenCaptureByWindowId | Shares the whole or part of a window by specifying the window ID. |
SetScreenCaptureContentHint | Sets the content hint for screen sharing. |
UpdateScreenCaptureParameters | Updates the screen sharing parameters. |
UpdateScreenCaptureRegion | Updates the screen sharing region. |
StopScreenCapture | Stops screen sharing. |
Method | Description |
---|---|
StartAudioMixing | Starts playing and mixing the music file. |
StopAudioMixing | Stops playing and 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. |
AdjustAudioMixingPlayoutVolume | Adjusts the volume of audio mixing for local playback. |
AdjustAudioMixingPublishVolume | Adjusts the volume of audio mixing for remote playback. |
SetAudioMixingPitch | Sets the pitch of the local music file. |
GetAudioMixingPlayoutVolume | Gets the audio mixing volume for local playback. |
GetAudioMixingPublishVolume | Gets the audio mixing volume for publishing. |
GetAudioMixingDuration | Gets the total duration (ms) of the music file. |
GetAudioMixingCurrentPosition | Gets the playback position (ms) of the music file. |
SetAudioMixingPosition | Sets the playback position of the music file. |
Event | Description |
---|---|
OnAudioMixingStateChangedHandler | Occurs when the playback state of the local user's music file changes. |
OnRemoteAudioMixingBeginHandler | Occurs when a remote user starts audio mixing. |
OnRemoteAudioMixingEndHandler | Occurs when a remote user finishes audio mixing. |
This group of methods apply to interactive live streaming only.
Method | Description |
---|---|
SetLiveTranscoding | Sets the video layout and audio for CDN live. |
AddPublishStreamUrl | Adds a CDN stream address. |
RemovePublishStreamUrl | Removes a CDN stream address. |
Event | Description |
---|---|
OnRtmpStreamingStateChangedHandler | Occurs when the state of the RTMP or RTMPS streaming changes. |
OnRtmpStreamingEventHandler | Reports events during the RTMP or RTMPS streaming. |
OnTranscodingUpdatedHandler | Occurs when the publisher's transcoding settings are updated. |
This group of methods apply to interactive live streaming only.
Method | Description |
---|---|
StartChannelMediaRelay | Starts to relay media streams across channels. |
UpdateChannelMediaRelay | Updates the channels for media stream relay. |
StopChannelMediaRelay | Stops the media stream relay. |
Event | Description |
---|---|
OnChannelMediaRelayStateChangedHandler | Occurs when the state of the media stream relay changes. |
OnChannelMediaRelayEventHandler | Reports events during the media stream relay. |
This group of methods applies to Android and iOS only.
Method | Description |
---|---|
EnableInEarMonitoring | Enables in-ear monitoring. |
SetInEarMonitoringVolume | Sets the volume of the in-ear monitor. |
Method | Description |
---|---|
EnableDualStreamMode | Enables/disables dual video stream mode. |
SetRemoteVideoStreamType | Sets the remote user’s video stream type received by the local user when the remote user sends dual streams. |
SetRemoteDefaultVideoStreamType | Sets the default video-stream type for the video received by the local user when the remote user sends dual streams. |
Method | Description |
---|---|
SetLocalPublishFallbackOption | Sets the fallback option for the published video stream under unreliable network conditions. |
SetRemoteSubscribeFallbackOption | Sets the fallback option for the remote stream under unreliable network conditions. |
SetRemoteUserPriority | Prioritizes a remote user's stream. |
Event | Description |
---|---|
OnLocalPublishFallbackToAudioOnlyHandler | Occurs:
|
OnRemoteSubscribeFallbackToAudioOnlyHandler | Occurs:
|
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. |
StartLastmileProbeTest | Starts the last-mile network probe test. |
StopLastmileProbeTest | Stops the last-mile network probe test. |
Event | Description |
---|---|
OnLastmileQualityHandler | Reports the last mile network quality of the local user before the user joins the channel. |
OnLastmileProbeResultHandler | Reports the last-mile network probe result. |
Method | Description |
---|---|
SetExternalVideoSource | Configures the external video source. |
PushVideoFrame | Pushes the external video frame. |
Method | Description |
---|---|
SetExternalAudioSource | Configures the external audio source. |
PushAudioFrame | Pushes the external audio frame. |
This group of methods applies to Windows only.
Method | Description |
---|---|
SetExternalAudioSink | Sets the external audio sink. |
PullAudioFrame | Pulls the external audio frame. |
Method | Description |
---|---|
RegisterAudioRawDataObserver | Registers an audio frame observer object. |
UnRegisterAudioRawDataObserver | UnRegisters the audio raw data observer. |
SetOnRecordAudioFrameCallback | Listens for the OnRecordAudioFrameHandler delegate. |
SetOnPlaybackAudioFrameCallback | Listens for the OnPlaybackAudioFrameHandler delegate. |
SetOnPlaybackAudioFrameBeforeMixingCallback | Listens for the OnPlaybackAudioFrameBeforeMixingHandler delegate. |
SetOnMixedAudioFrameCallback | Listens for the OnMixedAudioFrameHandler delegate. |
Event | Description |
---|---|
OnRecordAudioFrameHandler | Retrieves the recorded audio frame. |
OnPlaybackAudioFrameHandler | Retrieves the audio playback frame. |
OnPlaybackAudioFrameBeforeMixingHandler | Retrieves the audio frame of a specified user before mixing. |
OnMixedAudioFrameHandler | Retrieves the mixed recorded and playback audio frame. |
Method | Description |
---|---|
RegisterVideoRawDataObserver | Registers a video frame observer object. |
UnRegisterVideoRawDataObserver | UnRegisters the video raw data observer. |
SetOnCaptureVideoFrameCallback | Listens for the OnCaptureVideoFrameHandler delegate. |
SetOnRenderVideoFrameCallback | Listens for the OnRenderVideoFrameHandler delegate. |
Event | Description |
---|---|
OnCaptureVideoFrameHandler | Occurs when the camera captured image is received. |
OnRenderVideoFrameHandler | Processes the received image of the specified user (post-processing). |
This group of methods apply to interactive live streaming only.
Method | Description |
---|---|
RegisterMediaMetadataObserver | Registers a metadata observer. |
UnRegisterMediaMetadataObserver | Unregisters a metadata observer. |
Event | Description |
---|---|
OnGetMaxMetadataSizeHandler | Occurs when the SDK requests the maximum size of the metadata. |
OnReadyToSendMetadataHandler | Occurs when the SDK is ready to receive and send metadata. |
OnMediaMetaDataReceivedHandler | Occurs when the local user receives the metadata. |
This group of methods apply to interactive live streaming only.
Method | Description |
---|---|
AddVideoWatermark | Adds a watermark image to the local video stream. |
ClearVideoWatermarks | Removes the added watermark image from the video stream. |
Method | Description |
---|---|
EnableEncryption | Enables/Disables the built-in encryption. |
RegisterPacketObserver | Registers a packet observer. |
UnRegisterPacketObserver | UnRegisters the packet observer. |
Method | Description |
---|---|
StartAudioRecording | Starts an audio recording on the client. |
StopAudioRecording | Stops an audio recording on the client. |
Method | Description |
---|---|
SwitchCamera | Switches between front and rear cameras (for Android and iOS only). |
This group of methods applies to Windows and macOS only.
Method | Description |
---|---|
CreateAAudioPlaybackDeviceManager | Creates an AudioPlaybackDeviceManager instance. |
ReleaseAAudioPlaybackDeviceManager | Releases an AudioPlaybackDeviceManager instance. |
CreateAAudioRecordingDeviceManager | Creates an AudioRecordingDeviceManager instance. |
ReleaseAAudioRecordingDeviceManager | Releases an AudioRecordingDeviceManager instance. |
GetAudioPlaybackDeviceCount | Retrieves the total number of the indexed audio playback devices in the system. |
GetAudioRecordingDeviceCount | Retrieves the total number of the indexed audio capturing devices in the system. |
GetAudioPlaybackDevice | Retrieves the audio playback device associated with the index. |
GetAudioRecordingDevice | Retrieves the audio capturing device associated with the index. |
SetAudioPlaybackDevice | Sets the audio playback device using the device ID. |
SetAudioRecordingDevice | Sets the audio capturing device using the device ID. |
StartAudioPlaybackDeviceTest | Starts the test of the current audio playback device. |
StopAudioPlaybackDeviceTest | Stops the test of the current audio playback device. |
StartAudioRecordingDeviceTest | Starts the test of the current audio capturing device. |
StopAudioRecordingDeviceTest | Stops the test of the current audio capturing device. |
SetAudioPlaybackDeviceVolume | Sets the volume of the current audio playback device. |
GetAudioPlaybackDeviceVolume | Retrieves the volume of the current audio playback device. |
SetAudioRecordingDeviceVolume | Sets the volume of the current audio capturing device. |
GetAudioRecordingDeviceVolume | Retrieves the volume of the current audio capturing device. |
SetAudioPlaybackDeviceMute | Sets whether to stop audio playback. |
IsAudioPlaybackDeviceMute | Retrieves the status of the current audio playback device. |
SetAudioRecordingDeviceMute | Sets whether to stop audio capturing. |
IsAudioRecordingDeviceMute | Gets the status of the current audio capturing device. |
GetCurrentPlaybackDevice | Retrieves the device ID of the current audio playback device. |
GetCurrentRecordingDevice | Retrieves the device ID of the current audio capturing device. |
GetCurrentPlaybackDeviceInfo | Retrieves the device information of the current audio playback device. |
GetCurrentRecordingDeviceInfo | Retrieves the device information of the current audio capturing device. |
Event | Description |
---|---|
OnAudioDeviceStateChangedHandler | Occurs when the audio device state changes. |
OnAudioDeviceVolumeChangedHandler | Occurs when the volume of the playback, microphone, or application changes. (Windows only) |
This group of methods applies to Windows and macOS only.
Method | Description |
---|---|
CreateAVideoDeviceManager | Creates an VideoDeviceManager instance. |
ReleaseAVideoDeviceManager | Releases an VideoDeviceManager instance. |
GetVideoDeviceCount | Retrieves the total number of the indexed video capturing devices in the system. |
GetVideoDevice | Retrieves the video capturing device associated with the index. |
SetVideoDevice | Sets the video capturing device using the device ID. |
StartVideoDeviceTest | Starts the video capturing device test. |
StopVideoDeviceTest | Stops the video capturing device test. |
GetCurrentVideoDevice | Retrieves the device ID of the current video capturing device. |
Event | Description |
---|---|
OnVideoDeviceStateChangedHandler | Occurs when the video device state changes. |
Method | Description |
---|---|
CreateDataStream | Creates a data stream. |
SendStreamMessage | Sends data stream messages to all users in a channel. |
Event | Description |
---|---|
OnStreamMessageHandler | Occurs when the local user receives the data stream from the remote user within five seconds. |
OnStreamMessageErrorHandler | Occurs when the local user does not receive the data stream from the remote user within five seconds. |
Method | Description |
---|---|
EnableLoopbackRecording | Enables loopback capturing (for macOS and Windows only). |
SetAudioSessionOperationRestriction | Sets the audio session’s operational restriction (for iOS only). |
Method | Description |
---|---|
SetCameraCapturerConfiguration | Sets the camera capturer configuration. |
Method | Description |
---|---|
SetGameFps | Sets the video rendering frame rate. |
EnableFilpTextureApply | Enables/Disables the mirror mode when renders the Texture. |
SetVideoSurfaceType | Set the video renderer type. |
SetEnable | Starts/Stops the video rendering. |
SetCloudProxy | Sets the Agora cloud proxy service. |
EnableDeepLearningDenoise | Enables/Disables deep-learning noise reduction. |
SendCustomReportMessage | Reports customized messages. |
GetCallId | Retrieves the current call ID. |
Rate | Allows the user to rate the call and is called 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 | Retrieves the description of a warning or error code. |
Event | Description |
---|---|
OnSDKWarningHandler | Reports a warning during SDK runtime. |
OnSDKErrorHandler | Reports an error during SDK runtime. |
OnApiExecutedHandler | Occurs when a method is executed by the SDK. |