#include <IAgoraRtcEngine.h>
Inherited by agora::rtc::IRtcEngine2.
Public Types | |
typedef unsigned int | WindowIDType |
typedef HWND | WindowIDType |
Public Member Functions | |
virtual int | initialize (const RtcEngineContext &context)=0 |
virtual int | setChannelProfile (CHANNEL_PROFILE_TYPE profile)=0 |
virtual int | setClientRole (CLIENT_ROLE_TYPE role)=0 |
virtual int | setClientRole (CLIENT_ROLE_TYPE role, const ClientRoleOptions &options)=0 |
virtual int | joinChannel (const char *token, const char *channelId, const char *info, uid_t uid)=0 |
virtual int | joinChannel (const char *token, const char *channelId, const char *info, uid_t uid, const ChannelMediaOptions &options)=0 |
virtual int | switchChannel (const char *token, const char *channelId)=0 |
virtual int | switchChannel (const char *token, const char *channelId, const ChannelMediaOptions &options)=0 |
virtual int | leaveChannel ()=0 |
virtual int | renewToken (const char *token)=0 |
virtual int | queryInterface (INTERFACE_ID_TYPE iid, void **inter)=0 |
virtual int | registerLocalUserAccount (const char *appId, const char *userAccount)=0 |
virtual int | joinChannelWithUserAccount (const char *token, const char *channelId, const char *userAccount)=0 |
virtual int | joinChannelWithUserAccount (const char *token, const char *channelId, const char *userAccount, const ChannelMediaOptions &options)=0 |
virtual int | getUserInfoByUserAccount (const char *userAccount, UserInfo *userInfo)=0 |
virtual int | getUserInfoByUid (uid_t uid, UserInfo *userInfo)=0 |
virtual int | startEchoTest ()=0 |
virtual int | startEchoTest (int intervalInSeconds)=0 |
virtual int | startEchoTest (const EchoTestConfiguration &config)=0 |
virtual int | stopEchoTest ()=0 |
virtual int | setCloudProxy (CLOUD_PROXY_TYPE proxyType)=0 |
virtual int | enableVideo ()=0 |
virtual int | disableVideo ()=0 |
virtual int | setVideoProfile (VIDEO_PROFILE_TYPE profile, bool swapWidthAndHeight) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | setVideoEncoderConfiguration (const VideoEncoderConfiguration &config)=0 |
virtual int | setCameraCapturerConfiguration (const CameraCapturerConfiguration &config)=0 |
virtual int | setupLocalVideo (const VideoCanvas &canvas)=0 |
virtual int | setupRemoteVideo (const VideoCanvas &canvas)=0 |
virtual int | startPreview ()=0 |
virtual int | setRemoteUserPriority (uid_t uid, PRIORITY_TYPE userPriority)=0 |
virtual int | stopPreview ()=0 |
virtual int | enableAudio ()=0 |
virtual int | enableLocalAudio (bool enabled)=0 |
virtual int | disableAudio ()=0 |
virtual int | setAudioProfile (AUDIO_PROFILE_TYPE profile, AUDIO_SCENARIO_TYPE scenario)=0 |
virtual int | muteLocalAudioStream (bool mute)=0 |
virtual int | muteAllRemoteAudioStreams (bool mute)=0 |
virtual int | setDefaultMuteAllRemoteAudioStreams (bool mute) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | adjustUserPlaybackSignalVolume (unsigned int uid, int volume)=0 |
virtual int | muteRemoteAudioStream (uid_t userId, bool mute)=0 |
virtual int | muteLocalVideoStream (bool mute)=0 |
virtual int | enableLocalVideo (bool enabled)=0 |
virtual int | muteAllRemoteVideoStreams (bool mute)=0 |
virtual int | setDefaultMuteAllRemoteVideoStreams (bool mute) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | muteRemoteVideoStream (uid_t userId, bool mute)=0 |
virtual int | setRemoteVideoStreamType (uid_t userId, REMOTE_VIDEO_STREAM_TYPE streamType)=0 |
virtual int | setRemoteDefaultVideoStreamType (REMOTE_VIDEO_STREAM_TYPE streamType)=0 |
virtual int | enableAudioVolumeIndication (int interval, int smooth, bool report_vad)=0 |
virtual int | enableLocalVoicePitchCallback (int interval)=0 |
virtual int | startAudioRecording (const char *filePath, AUDIO_RECORDING_QUALITY_TYPE quality) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | startAudioRecording (const char *filePath, int sampleRate, AUDIO_RECORDING_QUALITY_TYPE quality) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | startAudioRecording (const AudioRecordingConfiguration &config)=0 |
virtual int | stopAudioRecording ()=0 |
virtual int | startAudioMixing (const char *filePath, bool loopback, bool replace, int cycle) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | startAudioMixing (const char *filePath, bool loopback, bool replace, int cycle, int startPos)=0 |
virtual int | setAudioMixingPlaybackSpeed (int speed)=0 |
virtual int | stopAudioMixing ()=0 |
virtual int | pauseAudioMixing ()=0 |
virtual int | selectAudioTrack (int index)=0 |
virtual int | getAudioTrackCount ()=0 |
virtual int | setAudioMixingDualMonoMode (agora::media::AUDIO_MIXING_DUAL_MONO_MODE mode)=0 |
virtual int | resumeAudioMixing ()=0 |
virtual int | setHighQualityAudioParameters (bool fullband, bool stereo, bool fullBitrate)=0 |
virtual int | adjustAudioMixingVolume (int volume)=0 |
virtual int | adjustAudioMixingPlayoutVolume (int volume)=0 |
virtual int | getAudioMixingPlayoutVolume ()=0 |
virtual int | adjustAudioMixingPublishVolume (int volume)=0 |
virtual int | getAudioMixingPublishVolume ()=0 |
virtual int | getAudioMixingDuration () AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | getAudioMixingCurrentPosition ()=0 |
virtual int | setAudioMixingPosition (int pos)=0 |
virtual int | setAudioMixingPitch (int pitch)=0 |
virtual int | getEffectsVolume ()=0 |
virtual int | setEffectsVolume (int volume)=0 |
virtual int | setVolumeOfEffect (int soundId, int volume)=0 |
virtual int | enableFaceDetection (bool enable)=0 |
virtual int | playEffect (int soundId, const char *filePath, int loopCount, double pitch, double pan, int gain, bool publish=false) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | playEffect (int soundId, const char *filePath, int loopCount, double pitch, double pan, int gain, bool publish, int startPos)=0 |
virtual int | stopEffect (int soundId)=0 |
virtual int | stopAllEffects ()=0 |
virtual int | preloadEffect (int soundId, const char *filePath)=0 |
virtual int | unloadEffect (int soundId)=0 |
virtual int | pauseEffect (int soundId)=0 |
virtual int | pauseAllEffects ()=0 |
virtual int | resumeEffect (int soundId)=0 |
virtual int | resumeAllEffects ()=0 |
virtual int | getEffectDuration (const char *filePath)=0 |
virtual int | setEffectPosition (int soundId, int pos)=0 |
virtual int | getEffectCurrentPosition (int soundId)=0 |
virtual int | getAudioFileInfo (const char *filePath)=0 |
virtual int | enableDeepLearningDenoise (bool enable)=0 |
virtual int | enableSoundPositionIndication (bool enabled)=0 |
virtual int | setRemoteVoicePosition (uid_t uid, double pan, double gain)=0 |
virtual int | setLocalVoicePitch (double pitch)=0 |
virtual int | setLocalVoiceEqualization (AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, int bandGain)=0 |
virtual int | setLocalVoiceReverb (AUDIO_REVERB_TYPE reverbKey, int value)=0 |
virtual int | setLocalVoiceChanger (VOICE_CHANGER_PRESET voiceChanger) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | setLocalVoiceReverbPreset (AUDIO_REVERB_PRESET reverbPreset) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | setVoiceBeautifierPreset (VOICE_BEAUTIFIER_PRESET preset)=0 |
virtual int | setAudioEffectPreset (AUDIO_EFFECT_PRESET preset)=0 |
virtual int | setVoiceConversionPreset (VOICE_CONVERSION_PRESET preset)=0 |
virtual int | setAudioEffectParameters (AUDIO_EFFECT_PRESET preset, int param1, int param2)=0 |
virtual int | setVoiceBeautifierParameters (VOICE_BEAUTIFIER_PRESET preset, int param1, int param2)=0 |
virtual int | setLogFile (const char *filePath) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | setLogFilter (unsigned int filter) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | setLogFileSize (unsigned int fileSizeInKBytes) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | setLocalRenderMode (RENDER_MODE_TYPE renderMode) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | setLocalRenderMode (RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode)=0 |
virtual int | setRemoteRenderMode (uid_t userId, RENDER_MODE_TYPE renderMode) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | setRemoteRenderMode (uid_t userId, RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode)=0 |
virtual int | setLocalVideoMirrorMode (VIDEO_MIRROR_MODE_TYPE mirrorMode) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | enableDualStreamMode (bool enabled)=0 |
virtual int | setExternalAudioSource (bool enabled, int sampleRate, int channels)=0 |
virtual int | setExternalAudioSink (bool enabled, int sampleRate, int channels)=0 |
virtual int | setRecordingAudioFrameParameters (int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall)=0 |
virtual int | setPlaybackAudioFrameParameters (int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall)=0 |
virtual int | setMixedAudioFrameParameters (int sampleRate, int samplesPerCall)=0 |
virtual int | adjustRecordingSignalVolume (int volume)=0 |
virtual int | adjustPlaybackSignalVolume (int volume)=0 |
virtual int | adjustLoopbackRecordingSignalVolume (int volume)=0 |
virtual int | enableWebSdkInteroperability (bool enabled) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | setVideoQualityParameters (bool preferFrameRateOverImageQuality)=0 |
virtual int | setLocalPublishFallbackOption (STREAM_FALLBACK_OPTIONS option)=0 |
virtual int | setRemoteSubscribeFallbackOption (STREAM_FALLBACK_OPTIONS option)=0 |
virtual int | switchCamera ()=0 |
virtual int | setDefaultAudioRouteToSpeakerphone (bool defaultToSpeaker)=0 |
virtual int | setEnableSpeakerphone (bool speakerOn)=0 |
virtual int | enableInEarMonitoring (bool enabled)=0 |
virtual int | setInEarMonitoringVolume (int volume)=0 |
virtual bool | isSpeakerphoneEnabled ()=0 |
virtual int | setAudioSessionOperationRestriction (AUDIO_SESSION_OPERATION_RESTRICTION restriction)=0 |
virtual int | enableLoopbackRecording (bool enabled, const char *deviceName=NULL)=0 |
virtual IScreenCaptureSourceList * | getScreenCaptureSources (const SIZE &thumbSize, const SIZE &iconSize, const bool includeScreen)=0 |
virtual int | startScreenCaptureByDisplayId (unsigned int displayId, const Rectangle ®ionRect, const ScreenCaptureParameters &captureParams)=0 |
virtual int | startScreenCaptureByScreenRect (const Rectangle &screenRect, const Rectangle ®ionRect, const ScreenCaptureParameters &captureParams)=0 |
virtual int | startScreenCaptureByWindowId (view_t windowId, const Rectangle ®ionRect, const ScreenCaptureParameters &captureParams)=0 |
virtual int | setScreenCaptureContentHint (VideoContentHint contentHint)=0 |
virtual int | setScreenCaptureScenario (SCREEN_SCENARIO_TYPE screenScenario)=0 |
virtual int | updateScreenCaptureParameters (const ScreenCaptureParameters &captureParams)=0 |
virtual int | updateScreenCaptureRegion (const Rectangle ®ionRect)=0 |
virtual int | stopScreenCapture ()=0 |
virtual int | startScreenCapture (WindowIDType windowId, int captureFreq, const Rect *rect, int bitrate)=0 |
virtual int | updateScreenCaptureRegion (const Rect *rect)=0 |
virtual bool | setVideoSource (IVideoSource *source)=0 |
virtual int | getCallId (agora::util::AString &callId)=0 |
virtual int | rate (const char *callId, int rating, const char *description)=0 |
virtual int | complain (const char *callId, const char *description)=0 |
virtual const char * | getVersion (int *build)=0 |
virtual int | enableLastmileTest ()=0 |
virtual int | disableLastmileTest ()=0 |
virtual int | startLastmileProbeTest (const LastmileProbeConfig &config)=0 |
virtual int | stopLastmileProbeTest ()=0 |
virtual const char * | getErrorDescription (int code)=0 |
virtual int | setEncryptionSecret (const char *secret) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | setEncryptionMode (const char *encryptionMode) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | enableEncryption (bool enabled, const EncryptionConfig &config)=0 |
virtual int | registerPacketObserver (IPacketObserver *observer)=0 |
virtual int | createDataStream (int *streamId, bool reliable, bool ordered) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | createDataStream (int *streamId, DataStreamConfig &config)=0 |
virtual int | sendStreamMessage (int streamId, const char *data, size_t length)=0 |
virtual int | addPublishStreamUrl (const char *url, bool transcodingEnabled) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | removePublishStreamUrl (const char *url) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | setLiveTranscoding (const LiveTranscoding &transcoding) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | startRtmpStreamWithoutTranscoding (const char *url)=0 |
virtual int | startRtmpStreamWithTranscoding (const char *url, const LiveTranscoding &transcoding)=0 |
virtual int | updateRtmpTranscoding (const LiveTranscoding &transcoding)=0 |
virtual int | stopRtmpStream (const char *url)=0 |
virtual int | addVideoWatermark (const RtcImage &watermark)=0 |
virtual int | addVideoWatermark (const char *watermarkUrl, const WatermarkOptions &options)=0 |
virtual int | clearVideoWatermarks ()=0 |
virtual int | setBeautyEffectOptions (bool enabled, BeautyOptions options)=0 |
virtual int | setLowlightEnhanceOptions (bool enabled, LowLightEnhanceOptions options)=0 |
virtual int | setVideoDenoiserOptions (bool enabled, VideoDenoiserOptions options)=0 |
virtual int | setColorEnhanceOptions (bool enabled, ColorEnhanceOptions options)=0 |
virtual int | enableVirtualBackground (bool enabled, VirtualBackgroundSource backgroundSource)=0 |
virtual int | startChannelMediaRelay (const ChannelMediaRelayConfiguration &configuration)=0 |
virtual int | updateChannelMediaRelay (const ChannelMediaRelayConfiguration &configuration)=0 |
virtual int | pauseAllChannelMediaRelay ()=0 |
virtual int | resumeAllChannelMediaRelay ()=0 |
virtual int | stopChannelMediaRelay ()=0 |
virtual bool | registerEventHandler (IRtcEngineEventHandler *eventHandler)=0 |
virtual bool | unregisterEventHandler (IRtcEngineEventHandler *eventHandler)=0 |
virtual int | sendCustomReportMessage (const char *id, const char *category, const char *event, const char *label, int value)=0 |
virtual CONNECTION_STATE_TYPE | getConnectionState ()=0 |
virtual int | enableRemoteSuperResolution (uid_t userId, bool enable) AGORA_DEPRECATED_ATTRIBUTE=0 |
virtual int | enableRemoteSuperResolution (bool enabled, SR_MODE mode, uid_t userId)=0 |
virtual int | registerMediaMetadataObserver (IMetadataObserver *observer, IMetadataObserver::METADATA_TYPE type)=0 |
virtual int | setParameters (const char *parameters)=0 |
virtual int | setLocalVideoRenderer (IVideoSink *videoSink)=0 |
virtual int | setRemoteVideoRenderer (uid_t uid, IVideoSink *videoSink)=0 |
virtual int | setCameraTorchOn (bool isOn)=0 |
virtual bool | isCameraTorchSupported ()=0 |
virtual int | setCameraZoomFactor (float factor)=0 |
virtual float | getCameraMaxZoomFactor ()=0 |
virtual bool | isCameraZoomSupported ()=0 |
virtual bool | isCameraFocusSupported ()=0 |
virtual bool | isCameraExposurePositionSupported ()=0 |
virtual bool | isCameraAutoFocusFaceModeSupported ()=0 |
virtual int | setCameraFocusPositionInPreview (float positionX, float positionY)=0 |
virtual int | setCameraExposurePosition (float positionXinView, float positionYinView)=0 |
virtual int | setCameraAutoFocusFaceModeEnabled (bool enabled)=0 |
virtual int | takeSnapshot (const char *channel, uid_t uid, const char *filePath)=0 |
Static Public Member Functions | |
static AGORA_CPP_API void | release (bool sync=false) |
Protected Member Functions | |
virtual | ~IRtcEngine () |
IRtcEngine is the base interface class of the Agora SDK that provides the main Agora SDK methods invoked by your application. Enable the Agora SDK's communication functionality through the creation of an IRtcEngine object, then call the methods of this object.
typedef unsigned int agora::rtc::IRtcEngine::WindowIDType |
typedef HWND agora::rtc::IRtcEngine::WindowIDType |
|
inlineprotectedvirtual |
|
pure virtual |
Initializes the Agora service.
Unless otherwise specified, all the methods provided by the IRtcEngine class are executed asynchronously. Agora recommends calling these methods in the same thread.
context | Pointer to the RTC engine context. See RtcEngineContext. |
IRtcEngineEventHandler
object is specified.context
is properly set.
|
static |
Releases all IRtcEngine resources.
Use this method for apps in which users occasionally make voice or video calls. When users do not make calls, you can free up resources for other operations. Once you call release
to destroy the created IRtcEngine
instance, you cannot use any method or callback in the SDK any more. If you want to use the real-time communication functions again, you must call createAgoraRtcEngine and initialize to create a new IRtcEngine
instance.
IRtcEngine
instance after destroying the current one, ensure that you wait till the release
method completes executing.sync |
|
|
pure virtual |
Sets the channel profile of the Agora IRtcEngine.
After initialization, the SDK uses the CHANNEL_PROFILE_COMMUNICATION
channel profile by default. You can call this method to set the channel profile. The Agora IRtcEngine differentiates channel profiles and applies optimization algorithms accordingly. For example, it prioritizes smoothness and low latency for a video call, and prioritizes video quality for the interactive live video streaming.
profile | The channel profile of the Agora IRtcEngine. See CHANNEL_PROFILE_TYPE |
|
pure virtual |
Sets the role of the user in interactive live streaming.
After calling setChannelProfile (CHANNEL_PROFILE_LIVE_BROADCASTING), the SDK sets the user role as audience by default. You can call setClientRole
to set the user role as host.
You can call this method either before or after joining a channel. If you call this method to switch the user role after joining a channel, the SDK automatically does the following:
LIVE_BROADCASTING
profile only.role | The role of a user in interactive live streaming. See CLIENT_ROLE_TYPE. |
joinChannel
with the options
parameter and use the default settings publishLocalAudio = true
or publishLocalVideo = true
.setClientRole
to set the user role as host.muteLocalAudioStream(false)
or muteLocalVideoStream(false)
.
|
pure virtual |
Sets the role of the user in interactive live streaming.
In the LIVE_BROADCASTING
channel profile, the SDK sets the user role as audience by default. You can call setClientRole
to set the user role as host.
You can call this method either before or after joining a channel. If you call this method to switch the user role after joining a channel, the SDK automatically does the following:
LIVE_BROADCASTING
profile only.role | The role of a user in interactive live streaming. See CLIENT_ROLE_TYPE. |
options | The detailed options of a user, including user level. See ClientRoleOptions. |
joinChannel
with the options
parameter and use the default settings publishLocalAudio = true
or publishLocalVideo = true
.setClientRole
to set the user role as host.muteLocalAudioStream(false)
or muteLocalVideoStream(false)
.
|
pure virtual |
Joins a channel with the user ID.
Users in the same channel can talk to each other, and multiple users in the same channel can start a group chat. Users with different App IDs cannot call each other.
You must call the leaveChannel method to exit the current call before entering another channel.
A successful joinChannel method call triggers the following callbacks:
COMMUNICATION
profile, or is a host in the LIVE_BROADCASTING
profile.When the connection between the client and Agora's server is interrupted due to poor network conditions, the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the onRejoinChannelSuccess callback on the local client.
Once the user joins the channel (switches to another channel), the user subscribes to the audio and video streams of all the other users in the channel by default, giving rise to usage and billing calculation. If you do not want to subscribe to a specified stream or all remote streams, call the mute
methods accordingly.
uid
. If you set uid
as 0, the system automatically assigns a uid
. If you want to join a channel from different devices, ensure that each device has a different uid. token | The token generated at your server. See Authenticate Your Users with Tokens. |
channelId | Pointer to the unique channel name for the Agora RTC session in the string format smaller than 64 bytes. Supported characters:
|
info | (Optional) Pointer to additional information about the channel. This parameter can be set to NULL or contain channel related information. Other users in the channel will not receive this message. |
uid | (Optional) User ID. A 32-bit unsigned integer with a value ranging from 1 to 232-1. The uid must be unique. If a uid is not assigned (or set to 0), the SDK assigns and returns a uid in the onJoinChannelSuccess callback. Your application must record and maintain the returned uid , because the SDK does not do so. |
|
pure virtual |
Joins a channel with the user ID, and configures whether to publish or automatically subscribe to the audio or video streams.
Users in the same channel can talk to each other, and multiple users in the same channel can start a group chat. Users with different App IDs cannot call each other.
You must call the leaveChannel method to exit the current call before entering another channel.
A successful joinChannel method call triggers the following callbacks:
COMMUNICATION
profile, or is a host in the LIVE_BROADCASTING
profile.When the connection between the client and the Agora server is interrupted due to poor network conditions, the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the onRejoinChannelSuccess callback on the local client.
options
parameter, which configures whether the user publishes or automatically subscribes to the audio and video streams in the channel when joining the channel. By default, the user publishes the local audio and video streams and automatically subscribes to the audio and video streams of all the other users in the channel. Subscribing incurs all associated usage costs. To unsubscribe, set the options
parameter or call the mute
methods accordingly.IRtcEngine
object.token | The token generated at your server. See Authenticate Your Users with Tokens. |
channelId | Pointer to the unique channel name for the Agora RTC session in the string format smaller than 64 bytes. Supported characters:
|
info | (Optional) Reserved for future use. |
uid | (Optional) User ID. A 32-bit unsigned integer with a value ranging from 1 to 232-1. The uid must be unique. If a uid is not assigned (or set to 0), the SDK assigns and returns a uid in the onJoinChannelSuccess callback. Your application must record and maintain the returned uid , because the SDK does not do so. Note: The ID of each user in the channel should be unique. If you want to join the same channel from different devices, ensure that the user IDs in all devices are different. |
options | The channel media options: ChannelMediaOptions. |
|
pure virtual |
Switches to a different channel.
This method allows the audience of a LIVE_BROADCASTING
channel to switch to a different channel.
After the user successfully switches to another channel, the onLeaveChannel and onJoinChannelSuccess callbacks are triggered to indicate that the user has left the original channel and joined a new one.
Once the user switches to another channel, the user subscribes to the audio and video streams of all the other users in the channel by default, giving rise to usage and billing calculation. If you do not want to subscribe to a specified stream or all remote streams, call the mute
methods accordingly.
LIVE_BROADCASTING
channel only.token | The token generated at your server. See Authenticate Your Users with Tokens. |
channelId | Unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
|
|
pure virtual |
Switches to a different channel, and configures whether to automatically subscribe to audio or video streams in the target channel.
This method allows the audience of a LIVE_BROADCASTING
channel to switch to a different channel.
After the user successfully switches to another channel, the onLeaveChannel and onJoinChannelSuccess callbacks are triggered to indicate that the user has left the original channel and joined a new one.
LIVE_BROADCASTING
channel only.options
parameter or call the mute
methods accordingly.token | The token generated at your server. See Authenticate Your Users with Tokens. |
channelId | Unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
|
options | The channel media options: ChannelMediaOptions. |
|
pure virtual |
Allows a user to leave a channel, such as hanging up or exiting a call.
After joining a channel, the user must call the leaveChannel method to end the call before joining another channel.
This method returns 0 if the user leaves the channel and releases all resources related to the call.
This method call is asynchronous, and the user has not left the channel when the method call returns. Once the user leaves the channel, the SDK triggers the onLeaveChannel callback.
A successful leaveChannel method call triggers the following callbacks:
COMMUNICATION
channel, or is a host in the LIVE_BROADCASTING
profile.
|
pure virtual |
Gets a new token when the current token expires after a period of time.
The token
expires after a period of time once the token schema is enabled when:
The application should call this method to get the new token
. Failure to do so will result in the SDK disconnecting from the server.
token | The new token. |
|
pure virtual |
Gets the pointer to the device manager object.
iid | ID of the interface. |
inter | Pointer to the DeviceManager object. |
|
pure virtual |
Registers a user account.
Once registered, the user account can be used to identify the local user when the user joins the channel. After the user successfully registers a user account, the SDK triggers the onLocalUserRegistered callback on the local client, reporting the user ID and user account of the local user.
To join a channel with a user account, you can choose either of the following:
The difference between the two is that for the former, the time elapsed between calling the joinChannelWithUserAccount method and joining the channel is shorter than the latter.
userAccount
parameter. Otherwise, this method does not take effect.userAccount
parameter is unique in the channel.appId | The App ID of your project. |
userAccount | The user account. The maximum length of this parameter is 255 bytes. Ensure that the user account is unique and do not set it as null. Supported character scopes are:
|
|
pure virtual |
Joins the channel with a user account.
After the user successfully joins the channel, the SDK triggers the following callbacks:
COMMUNICATION
profile, or is a host in the LIVE_BROADCASTING
profile.Once the user joins the channel (switches to another channel), the user subscribes to the audio and video streams of all the other users in the channel by default, giving rise to usage and billing calculation. If you do not want to subscribe to a specified stream or all remote streams, call the mute
methods accordingly.
token | The token generated at your server. See Authenticate Your Users with Tokens. |
channelId | The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
|
userAccount | The user account. The maximum length of this parameter is 255 bytes. Ensure that the user account is unique and do not set it as null. Supported character scopes are:
|
|
pure virtual |
Joins the channel with a user account, and configures whether to publish or automatically subscribe to the audio or video streams.
After the user successfully joins the channel, the SDK triggers the following callbacks:
COMMUNICATION
profile, or is a host in the LIVE_BROADCASTING
profile.options
parameter or call the mute
methods accordingly.token | The token generated at your server. See Authenticate Your Users with Tokens. |
channelId | The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
|
userAccount | The user account. The maximum length of this parameter is 255 bytes. Ensure that the user account is unique and do not set it as null. Supported character scopes are:
|
options | The channel media options: ChannelMediaOptions. |
|
pure virtual |
Gets the user information by passing in the user account.
After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object (userInfo
), and triggers the onUserInfoUpdated callback on the local client.
After receiving the oonUserInfoUpdated callback, you can call this method to get the user ID of the remote user from the userInfo
object by passing in the user account.
userAccount | The user account of the user. Ensure that you set this parameter. | |
[in,out] | userInfo | A userInfo object that identifies the user:
|
|
pure virtual |
Gets the user information by passing in the user ID.
After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object (userInfo
), and triggers the onUserInfoUpdated callback on the local client.
After receiving the onUserInfoUpdated callback, you can call this method to get the user account of the remote user from the userInfo
object by passing in the user ID.
uid | The user ID of the remote user. Ensure that you set this parameter. | |
[in,out] | userInfo | A userInfo object that identifies the user:
|
|
pure virtual |
Starts an audio call test.
This method starts an audio call test to check whether the audio devices (for example, headset and speaker) and the network connection are working properly.
To conduct the test:
LIVE_BROADCASTING
profile, only the hosts can call this method. If the user switches from the COMMUNICATION
toLIVE_BROADCASTING
profile, the user must call the setClientRole method to change the user role from the audience (default) to the host before calling this method.
|
pure virtual |
Starts an audio call test.
This method starts an audio call test to determine whether the audio devices (for example, headset and speaker) and the network connection are working properly.
In the audio call test, you record your voice. If the recording plays back within the set time interval, the audio devices and the network connection are working properly.
LIVE_BROADCASTING
profile, only a host can call this method. intervalInSeconds | The time interval (s) between when you speak and when the recording plays back. |
|
pure virtual |
Starts an audio and video call loop test.
Before joining a channel, to test whether the user's local sending and receiving streams are normal, you can call this method to perform an audio and video call loop test, which tests whether the audio and video devices and the user's upstream and downstream networks are working properly.
After starting the test, the user needs to make a sound or face the camera. The audio or video is output after about two seconds. If the audio playback is normal, the audio device and the user's upstream and downstream networks are working properly; if the video playback is normal, the video device and the user's upstream and downstream networks are working properly.
LIVE_BROADCASTING
profile, only a host can call this method.config | The configuration of the audio and video call loop test. See EchoTestConfiguration. |
|
pure virtual |
Stops call loop test.
After calling startEchoTest [2/3]
or startEchoTest [3/3]
, call this method if you want to stop the call loop test.
|
pure virtual |
Sets the Agora cloud proxy service.
When users' network access is restricted by a firewall, configure the firewall to allow specific IP addresses and ports provided by Agora; then, call this method to enable the cloud proxy and set the cloud proxy type with the proxyType
parameter.
After a successfully cloud proxy connection, the SDK triggers the onConnectionStateChanged (CONNECTION_STATE_CONNECTING, CONNECTION_CHANGED_SETTING_PROXY_SERVER) callback.
As of v3.6.2, when a user calls this method and then joins a channel successfully, the SDK triggers the onProxyConnected callback to report the user ID, the proxy type connected, and the time elapsed from the user calling joinChannel until this callback is triggered.
To disable the cloud proxy that has been set, call setCloudProxy(NONE_PROXY)
. To change the cloud proxy type that has been set, call setCloudProxy(NONE_PROXY)
first, and then call setCloudProxy
with the desired proxyType
.
proxyType | The cloud proxy type, see CLOUD_PROXY_TYPE. This parameter is required, and the SDK reports an error if you do not pass in a value. |
-2(ERR_INVALID_ARGUMENT)
: The parameter is invalid.-7(ERR_NOT_INITIALIZED)
: The SDK is not initialized.
|
pure virtual |
Enables the video module.
Call this method either before joining a channel or during a call. If this method is called before joining a channel, the call starts in the video mode. If this method is called during an audio call, the audio mode switches to the video mode. To disable the video module, call the disableVideo method.
A successful enableVideo method call triggers the onUserEnableVideo (true) callback on the remote client.
|
pure virtual |
Disables the video module.
This method can be called before joining a channel or during a call. If this method is called before joining a channel, the call starts in audio mode. If this method is called during a video call, the video mode switches to the audio mode. To enable the video module, call the enableVideo method.
A successful disableVideo method call triggers the onUserEnableVideo (false) callback on the remote client.
|
pure virtual |
Sets the video profile.
Each video profile includes a set of parameters, such as the resolution, frame rate, and bitrate. If the camera device does not support the specified resolution, the SDK automatically chooses a suitable camera resolution, keeping the encoder resolution specified by the setVideoProfile method.
profile | Sets the video profile. See VIDEO_PROFILE_TYPE. |
swapWidthAndHeight | Sets whether to swap the width and height of the video stream:
|
|
pure virtual |
Sets the video encoder configuration.
Each video encoder configuration corresponds to a set of video parameters, including the resolution, frame rate, bitrate, and video orientation.
The parameters specified in this method are the maximum values under ideal network conditions. If the video engine cannot render the video using the specified parameters due to poor network conditions, the parameters further down the list are considered until a successful configuration is found.
config | Sets the local video encoder configuration. See VideoEncoderConfiguration. |
|
pure virtual |
Sets the camera capture configuration.
For a video call or the interactive live video streaming, generally the SDK controls the camera output parameters. When the default camera capturer settings do not meet special requirements or cause performance problems, we recommend using this method to set the camera capturer configuration:
config | Sets the camera capturer configuration. See CameraCapturerConfiguration. |
|
pure virtual |
Initializes the local video view.
This method initializes the video view of a local stream on the local device. It affects only the video view that the local user sees, not the published local video stream.
Call this method to bind the local video stream to a video view and to set the rendering and mirror modes of the video view. The binding is still valid after the user leaves the channel, which means that the window still displays. To unbind the view, set the view in VideoCanvas to NULL.
canvas | Pointer to the local video view and settings. See VideoCanvas. |
|
pure virtual |
Initializes the video view of a remote user.
This method initializes the video view of a remote stream on the local device. It affects only the video view that the local user sees.
Call this method to bind the remote video stream to a video view and to set the rendering and mirror modes of the video view.
The application specifies the uid of the remote video in this method before the remote user joins the channel. If the remote uid is unknown to the application, set it after the application receives the onUserJoined callback. If the Video Recording function is enabled, the Video Recording Service joins the channel as a dummy client, causing other clients to also receive the onUserJoined callback. Do not bind the dummy client to the application view because the dummy client does not send any video streams. If your application does not recognize the dummy client, bind the remote user to the view when the SDK triggers the onFirstRemoteVideoDecoded callback. To unbind the remote user from the view, set the view in VideoCanvas to NULL. Once the remote user leaves the channel, the SDK unbinds the remote user.
canvas | Pointer to the remote video view and settings. See VideoCanvas. |
|
pure virtual |
Starts the local video preview before joining the channel.
Before calling this method, you must:
|
pure virtual |
Prioritizes a remote user's stream.
The SDK ensures the high-priority user gets the best possible stream quality.
userPriority
as high for one user only.uid | The ID of the remote user. |
userPriority | Sets the priority of the remote user. See PRIORITY_TYPE. |
|
pure virtual |
Stops the local video preview.
After calling startPreview, if you want to stop the local video preview, call stopPreview
.
|
pure virtual |
Enables the audio module.
The audio mode is enabled by default.
|
pure virtual |
Disables/Re-enables the local audio function.
The audio function is enabled by default. This method disables or re-enables the local audio function, that is, to stop or restart local audio capturing.
This method does not affect receiving the remote audio streams,and enableLocalAudio(false) is applicable to scenarios where the user wants to receive remote audio streams without sending any audio stream to other users in the channel.
Once the local audio function is disabled or re-enabled, the SDK triggers the onLocalAudioStateChanged callback, which reports LOCAL_AUDIO_STREAM_STATE_STOPPED(0)
or LOCAL_AUDIO_STREAM_STATE_RECORDING(1)
.
enableLocalAudio
method, the local user may hear a pause in the remote audio playback.enabled | Sets whether to disable/re-enable the local audio function:
|
|
pure virtual |
Disables the audio module.
|
pure virtual |
Sets the audio parameters and application scenarios.
setAudioProfile
method must be called before the joinChannel method.COMMUNICATION
and LIVE_BROADCASTING
profiles, the bitrate may be different from your settings due to network self-adaptation.profile | Sets the sample rate, bitrate, encoding mode, and the number of channels. See AUDIO_PROFILE_TYPE. |
scenario | Sets the audio application scenario. See AUDIO_SCENARIO_TYPE. Under different audio scenarios, the device uses different volume types. For details, see What is the difference between the in-call volume and the media volume?. |
|
pure virtual |
Stops or resumes publishing the local audio stream.
As of v3.4.5, this method only sets the publishing state of the audio stream in the channel of IRtcEngine.
A successful method call triggers the onUserMuteAudio callback on the remote client.
You can only publish the local stream in one channel at a time. If you create multiple channels, ensure that you only call muteLocalAudioStream (false) in one channel; otherwise, the method call fails, and the SDK returns -5 (ERR_REFUSED)
.
mute | Sets whether to stop publishing the local audio stream.
|
-5 (ERR_REFUSED)
: The request is rejected.
|
pure virtual |
Stops or resumes subscribing to the audio streams of all remote users.
After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users.
muteAllRemoteAudioStreams
and setDefaultMuteAllRemoteAudioStreams
together; otherwise, the settings may not take effect. See Set the Subscribing State.mute | Sets whether to stop subscribing to the audio streams of all remote users.
|
|
pure virtual |
Stops or resumes subscribing to the audio streams of all remote users by default.
Call this method after joining a channel. After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all subsequent users.
mute | Sets whether to stop subscribing to the audio streams of all remote users by default.
|
|
pure virtual |
Adjusts the playback signal volume of a specified remote user.
You can call this method as many times as necessary to adjust the playback volume of different remote users, or to repeatedly adjust the playback volume of the same remote user.
uid | The ID of the remote user. |
volume | The playback volume of the specified remote user. The value ranges between 0 and 100, including the following:
|
|
pure virtual |
Stops or resumes subscribing to the audio stream of a specified user.
userId | The user ID of the specified remote user. |
mute | Sets whether to stop subscribing to the audio stream of a specified user.
|
|
pure virtual |
Stops or resumes publishing the local video stream.
As of v3.4.5, this method only sets the publishing state of the video stream in the channel of IRtcEngine.
A successful method call triggers the onUserMuteVideo callback on the remote client.
You can only publish the local stream in one channel at a time. If you create multiple channels, ensure that you only call muteLocalVideoStream (false) in one channel; otherwise, the method call fails, and the SDK returns -5 (ERR_REFUSED)
.
mute | Sets whether to stop publishing the local video stream.
|
-5 (ERR_REFUSED)
: The request is rejected.
|
pure virtual |
Enables/Disables the local video capture.
This method disables or re-enables the local video capturer, and does not affect receiving the remote video stream.
After you call the enableVideo method, the local video capturer is enabled by default. You can call enableLocalVideo(false) to disable the local video capturer. If you want to re-enable it, call enableLocalVideo(true).
After the local video capturer is successfully disabled or re-enabled, the SDK triggers the onUserEnableLocalVideo callback on the remote client.
enabled | Sets whether to disable/re-enable the local video, including the capturer, renderer, and sender:
|
|
pure virtual |
Stops or resumes subscribing to the video streams of all remote users.
After successfully calling this method, the local user stops or resumes subscribing to the video streams of all remote users, including all subsequent users.
mute | Sets whether to stop subscribing to the video streams of all remote users.
|
|
pure virtual |
Stops or resumes subscribing to the video streams of all remote users by default.
Call this method after joining a channel. After successfully calling this method, the local user stops or resumes subscribing to the video streams of all subsequent users.
mute | Sets whether to stop subscribing to the video streams of all remote users by default.
|
|
pure virtual |
Stops or resumes subscribing to the video stream of a specified user.
userId | The user ID of the specified remote user. |
mute | Sets whether to stop subscribing to the video stream of a specified user.
|
|
pure virtual |
Sets the stream type of the remote video.
Under limited network conditions, if the publisher has not disabled the dual-stream mode using enableDualStreamMode(false)
, the receiver can choose to receive either the high-quality video stream (the high resolution, and high bitrate video stream) or the low-video stream (the low resolution, and low bitrate video stream).
By default, users receive the high-quality video stream. Call this method if you want to switch to the low-video stream. This method allows the app to adjust the corresponding video stream type based on the size of the video window to reduce the bandwidth and resources.
The aspect ratio of the low-video stream is the same as the high-quality video stream. Once the resolution of the high-quality video stream is set, the system automatically sets the resolution, frame rate, and bitrate of the low-video stream.
The method result returns in the onApiCallExecuted callback.
userId | ID of the remote user sending the video stream. |
streamType | Sets the video-stream type. See REMOTE_VIDEO_STREAM_TYPE. |
|
pure virtual |
Sets the default stream type of remote videos.
Under limited network conditions, if the publisher has not disabled the dual-stream mode using enableDualStreamMode(false)
, the receiver can choose to receive either the high-quality video stream (the high resolution, and high bitrate video stream) or the low-video stream (the low resolution, and low bitrate video stream).
By default, users receive the high-quality video stream. Call this method if you want to switch to the low-video stream. This method allows the app to adjust the corresponding video stream type based on the size of the video window to reduce the bandwidth and resources. The aspect ratio of the low-video stream is the same as the high-quality video stream. Once the resolution of the high-quality video stream is set, the system automatically sets the resolution, frame rate, and bitrate of the low-video stream.
The method result returns in the onApiCallExecuted callback.
setRemoteVideoStreamType
, the SDK applies the settings in the setRemoteVideoStreamType
method.streamType | Sets the default video-stream type. See REMOTE_VIDEO_STREAM_TYPE. |
|
pure virtual |
Enables the reporting of users' volume indication.
This method enables the SDK to regularly report the volume information of the local user who sends a stream and remote users (up to three) whose instantaneous volumes are the highest to the app. Once you call this method and users send streams in the channel, the SDK triggers the onAudioVolumeIndication callback at the time interval set in this method.
interval | Sets the time interval between two consecutive volume indications:
|
smooth | Smoothing factor sets the sensitivity of the audio volume indicator. The value ranges between 0 and 10. The greater the value, the more sensitive the indicator. The recommended value is 3. |
report_vad |
|
|
pure virtual |
Enables reporting the voice pitch of the local user.
This method enables the SDK to regularly report the voice pitch of the local user. After the local audio capture is enabled, and you call this method, the SDK triggers the onLocalVoicePitchInHz callback at the time interval set in this method.
interval | Sets the time interval at which the SDK triggers the onLocalVoicePitchInHz callback:
|
|
pure virtual |
Starts an audio recording.
The SDK allows recording during a call. Supported formats:
This method has a fixed sample rate of 32 kHz.
Ensure that the directory to save the recording file exists and is writable. This method is usually called after the joinChannel method. The recording automatically stops when the leaveChannel method is called.
filePath | Pointer to the absolute file path of the recording file. The string of the file name is in UTF-8. |
quality | Sets the audio recording quality. See AUDIO_RECORDING_QUALITY_TYPE. |
|
pure virtual |
Starts an audio recording on the client.
The SDK allows recording during a call. After successfully calling this method, you can record the audio of all the users in the channel and get an audio recording file. Supported formats of the recording file are as follows:
joinChannel
method. The recording automatically stops when you call the leaveChannel
method.sampleRate
is 44.1 kHz or 48 kHz.filePath | Pointer to the absolute file path of the recording file. The string of the file name is in UTF-8, such as c:/music/audio.aac. |
sampleRate | Sample rate (Hz) of the recording file. Supported values are as follows:
|
quality | Sets the audio recording quality. See AUDIO_RECORDING_QUALITY_TYPE. |
|
pure virtual |
Starts an audio recording on the client.
The SDK allows recording audio during a call. After successfully calling this method, you can record the audio of users in the channel and get an audio recording file. Supported file formats are as follows:
Once the user leaves the channel, the recording automatically stops.
config | Recording configuration. See AudioRecordingConfiguration. |
-160(ERR_ALREADY_IN_RECORDING)
: The client is already recording audio. To start a new recording, call stopAudioRecording to stop the current recording first, and then call startAudioRecording.
|
pure virtual |
Stops an audio recording on the client.
|
pure virtual |
Starts playing and mixing the music file.
This method mixes the specified local audio file with the audio stream from the microphone, or replaces the microphone's audio stream with the specified local audio file. You can choose whether the other user can hear the local audio playback and specify the number of playback loops. This method also supports online music playback.
When the audio mixing file playback finishes after calling this method, the SDK triggers the onAudioMixingFinished callback.
A successful startAudioMixing method call triggers the onAudioMixingStateChanged (PLAY) callback on the local client.
When the audio mixing file playback finishes, the SDK triggers the onAudioMixingStateChanged (STOPPED) callback on the local client.
AUDIO_MIXING_ERROR_TOO_FREQUENT_CALL(702)
error code occurs.android:usesCleartextTraffic="true"
to the /app/Manifests/AndroidManifest.xml
file.filePath | The absolute path or URL address (including the filename extensions) of the music file. For example: C:\music\audio.mp4 . When you access a local file on Android, Agora recommends passing a URI address or the path starts with /assets/ in this parameter. |
loopback | Sets which user can hear the audio mixing:
|
replace | Sets the audio mixing content:
|
cycle | Sets the number of playback loops:
|
|
pure virtual |
Starts playing and mixing the music file.
This method supports mixing or replacing local or online music file and audio collected by a microphone. After successfully playing the music file, the SDK triggers onAudioMixingStateChanged (AUDIO_MIXING_STATE_PLAYING,AUDIO_MIXING_REASON_STARTED_BY_USER). After completing playing the music file, the SDK triggers onAudioMixingStateChanged(AUDIO_MIXING_STATE_STOPPED,AUDIO_MIXING_REASON_ALL_LOOPS_COMPLETED)
.
/sdcard/
directory and the format is MP3.android:usesCleartextTraffic="true"
to the /app/Manifests/AndroidManifest.xml
file.filePath | The absolute path or URL address (including the filename extensions) of the music file. For example: C:\music\audio.mp4 . When you access a local file on Android, Agora recommends passing a URI address or the path starts with /assets/ in this parameter. |
loopback | Whether to only play the music file on the local client:
|
replace | Whether to replace the audio collected by the microphone with a music file:
|
cycle | The number of times the music file plays.
|
startPos | The playback position (ms) of the music file. |
|
pure virtual |
Sets the playback speed of the current music file.
speed | The playback speed. Agora recommends that you limit this value to between 50 and 400, defined as follows:
|
|
pure virtual |
Stops playing and mixing the music file.
Call this method when you are in a channel.
|
pure virtual |
Pauses playing and mixing the music file.
Call this method when you are in a channel.
|
pure virtual |
Specifies the playback track of the current music file.
After getting the number of audio tracks of the current music file, call this method to specify any audio track to play. For example, if different tracks of a multitrack file store songs in different languages, you can call this method to set the language of the music file to play.
index | The specified playback track. The value range is [0, getAudioTrackCount() ). |
|
pure virtual |
Gets the number of audio tracks of the current music file.
|
pure virtual |
Sets the channel mode of the current music file.
In a stereo music file, the left and right channels can store different audio data. According to your needs, you can set the channel mode to original mode, left channel mode, right channel mode, or mixed channel mode. For example, in the KTV scenario, the left channel of the music file stores the musical accompaniment, and the right channel stores the singing voice. If you only need to listen to the accompaniment, call this method to set the channel mode of the music file to left channel mode; if you need to listen to the accompaniment and the singing voice at the same time, call this method to set the channel mode to mixed channel mode.
mode | The channel mode. See AUDIO_MIXING_DUAL_MONO_MODE. |
|
pure virtual |
Resumes playing and mixing the music file.
Call this method when you are in a channel.
|
pure virtual |
Sets the high-quality audio preferences. Call this method and set all parameters before joining a channel.
Do not call this method again after joining a channel.
fullband | Sets whether to enable/disable full-band codec (48-kHz sample rate). Not compatible with SDK versions before v1.7.4:
|
stereo | Sets whether to enable/disable stereo codec. Not compatible with SDK versions before v1.7.4:
|
fullBitrate | Sets whether to enable/disable high-bitrate mode. Recommended in voice-only mode:
|
|
pure virtual |
Adjusts the volume during audio mixing.
volume | Audio mixing volume. The value ranges between 0 and 100 (default). |
|
pure virtual |
Adjusts the audio mixing volume for local playback.
volume | Audio mixing volume for local playback. The value ranges between 0 and 100 (default). |
|
pure virtual |
Gets the audio mixing volume for local playback.
This method helps troubleshoot audio volume related issues.
|
pure virtual |
Adjusts the audio mixing volume for publishing (for remote users).
volume | Audio mixing volume for publishing. The value ranges between 0 and 100 (default). |
|
pure virtual |
Gets the audio mixing volume for publishing.
This method helps troubleshoot audio volume related issues.
|
pure virtual |
Gets the duration (ms) of the music file.
|
pure virtual |
Gets the playback position (ms) of the music file.
getAudioMixingCurrentPosition
multiple times, ensure that the call interval is longer than 500 ms.
|
pure virtual |
Sets the playback position of the music file to a different starting position (the default plays from the beginning).
pos | The playback starting position (ms) of the music file. |
|
pure virtual |
Sets the pitch of the local music file.
When a local music file is mixed with a local human voice, call this method to set the pitch of the local music file only.
pitch | Sets the pitch of the local music file by chromatic scale. The default value is 0, which means keeping the original pitch. The value ranges from -12 to 12, and the pitch value between consecutive values is a chromatic value. The greater the absolute value of this parameter, the higher or lower the pitch of the local music file. |
|
pure virtual |
Gets the volume of the audio effects.
The value ranges between 0.0 and 100.0.
|
pure virtual |
Sets the volume of the audio effects.
volume | Sets the volume of the audio effects. The value ranges between 0 and 100 (default). |
|
pure virtual |
Sets the volume of a specified audio effect.
soundId | ID of the audio effect. Each audio effect has a unique ID. |
volume | Sets the volume of the specified audio effect. The value ranges between 0 and 100 (default). |
|
pure virtual |
Enables/Disables face detection for the local user.
Once face detection is enabled, the SDK triggers the onFacePositionChanged callback to report the face information of the local user, which includes the following aspects:
enable | Determines whether to enable the face detection function for the local user:
|
|
pure virtual |
Plays a specified local or online audio effect file.
This method allows you to set the loop count, pitch, pan, and gain of the audio effect file, as well as whether the remote user can hear the audio effect.
To play multiple audio effect files simultaneously, call this method multiple times with different soundIds and filePaths. We recommend playing no more than three audio effect files at the same time.
soundID
must be the same as that in the preloadEffect method.android:usesCleartextTraffic="true"
to the /app/Manifests/AndroidManifest.xml
file.playEffect
to play an online audio effect file, Agora recommends that you cache the online audio effect file to your local device, call preloadEffect
to preload the cached audio effect file into memory, and then call playEffect
to play the audio effect. Otherwise, you can experience playback failures and silence due to online audio effect file loading timeouts or loading failures.soundId | ID of the specified audio effect. Each audio effect has a unique ID. |
filePath | The absolute path or URL address (including the filename extensions) of the music file. For example: C:\music\audio.mp4 . When you access a local file on Android, Agora recommends passing a URI address or the path starts with /assets/ in this parameter. |
loopCount | Sets the number of times the audio effect loops:
|
pitch | Sets the pitch of the audio effect. The value ranges between 0.5 and 2. The default value is 1 (no change to the pitch). The lower the value, the lower the pitch. |
pan | Sets the spatial position of the audio effect. The value ranges between -1.0 and 1.0:
|
gain | Sets the volume of the audio effect. The value ranges between 0 and 100 (default). The lower the value, the lower the volume of the audio effect. |
publish | Sets whether to publish the specified audio effect to the remote stream:
|
|
pure virtual |
Plays a specified local or online audio effect file.
To play multiple audio effect files at the same time, call this method multiple times with different soundId
and filePath
values. For the best user experience, Agora recommends playing no more than three audio effect files at the same time.
After completing playing an audio effect file, the SDK triggers the onAudioEffectFinished callback.
android:usesCleartextTraffic="true"
to the /app/Manifests/AndroidManifest.xml
file.playEffect
to play an online audio effect file, Agora recommends that you cache the online audio effect file to your local device, call preloadEffect to preload the cached audio effect file into memory, and then call playEffect
to play the audio effect. Otherwise, you can experience playback failures and silence due to online audio effect file loading timeouts or loading failures.soundId | Audio effect ID. The ID of each audio effect file is unique. If you preloaded an audio effect into memory by calling preloadEffect, ensure that this parameter is set to the same value as in preloadEffect . |
filePath | The absolute path or URL address (including the filename extensions) of the music file. For example: C:\music\audio.mp4 . If you preloaded an audio effect into memory by calling preloadEffect, ensure that this parameter is set to the same value as in preloadEffect . When you access a local file on Android, Agora recommends passing a URI address or the path starts with /assets/ in this parameter. |
loopCount | The number of times the audio effect loops:
|
pitch | The pitch of the audio effect. The range is 0.5 to 2.0. The default value is 1.0, which means the original pitch. The lower the value, the lower the pitch. |
pan | The spatial position of the audio effect. The range is -1.0 to 1.0 . For example:
|
gain | The volume of the audio effect. The range is 0.0 to 100.0. The default value is 100.0, which means the original volume. The smaller the value, the less the gain. |
publish | Whether to publish the audio effect to the remote users:
|
startPos | The playback position (ms) of the audio effect file. |
|
pure virtual |
Stops playing a specified audio effect.
soundId | ID of the audio effect to stop playing. Each audio effect has a unique ID. |
|
pure virtual |
Stops playing all audio effects.
|
pure virtual |
Preloads a specified audio effect file into the memory.
soundId | ID of the audio effect. Each audio effect has a unique ID. |
filePath | The absolute path or URL address (including the filename extensions) of the music file. For example: C:\music\audio.mp4 . When you access a local file on Android, Agora recommends passing a URI address or the path starts with /assets/ in this parameter. |
|
pure virtual |
Releases a specified preloaded audio effect from the memory.
soundId | ID of the audio effect. Each audio effect has a unique ID. |
|
pure virtual |
Pauses a specified audio effect.
soundId | ID of the audio effect. Each audio effect has a unique ID. |
|
pure virtual |
Pauses all audio effects.
|
pure virtual |
Resumes playing a specified audio effect.
soundId | ID of the audio effect. Each audio effect has a unique ID. |
|
pure virtual |
Resumes playing all audio effects.
|
pure virtual |
Gets the information of a specified audio file.
After calling this method successfully, the SDK triggers the onRequestAudioFileInfo callback to report the information of an audio file, such as audio duration. You can call this method multiple times to get the information of multiple audio files.
getEffectDuration
has changed from getting the duration of a specified audio effect file to getting the information of a specified audio file.filePath | The file path:
|
|
pure virtual |
Sets the playback position of an audio effect file.
After a successful setting, the local audio effect file starts playing at the specified position.
soundId | Audio effect ID. Ensure that this parameter is set to the same value as in playEffect . |
pos | The playback position (ms) of the audio effect file. |
-22(ERR_RESOURCE_LIMITED)
: Cannot find the audio effect file. Please set a correct soundId
.
|
pure virtual |
Gets the playback position of the audio effect file.
soundId | Audio effect ID. Ensure that this parameter is set to the same value as in playEffect . |
-22(ERR_RESOURCE_LIMITED)
: Cannot find the audio effect file. Please set a correct soundId
.
|
pure virtual |
Gets the information of a specified audio file.
After calling this method successfully, the SDK triggers the onRequestAudioFileInfo callback to report the information of an audio file, such as audio duration. You can call this method multiple times to get the information of multiple audio files.
filePath | The file path:
|
|
pure virtual |
Enables or disables deep-learning noise reduction.
The SDK enables traditional noise reduction mode by default to reduce most of the stationary background noise. If you need to reduce most of the non-stationary background noise, Agora recommends enabling deep-learning noise reduction as follows:
libagora_ai_denoise_extension.so
AgoraAIDenoiseExtension.xcframework
libagora_ai_denoise_extension.dll
enableDeepLearningDenoise(true)
.Deep-learning noise reduction requires high-performance devices. For example, the following devices and later models are known to support deep-learning noise reduction:
After successfully enabling deep-learning noise reduction, if the SDK detects that the device performance is not sufficient, it automatically disables deep-learning noise reduction and enables traditional noise reduction.
If you call enableDeepLearningDenoise(false)
or the SDK automatically disables deep-learning noise reduction in the channel, when you need to re-enable deep-learning noise reduction, you need to call leaveChannel first, and then call enableDeepLearningDenoise(true)
.
enable | Sets whether to enable deep-learning noise reduction.
|
|
pure virtual |
Enables/Disables stereo panning for remote users.
Ensure that you call this method before joinChannel to enable stereo panning for remote users so that the local user can track the position of a remote user by calling setRemoteVoicePosition.
enabled | Sets whether to enable stereo panning for remote users:
|
|
pure virtual |
Sets the sound position and gain of a remote user.
When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, such as Battle Royale games.
uid | The ID of the remote user. |
pan | The sound position of the remote user. The value ranges from -1.0 to 1.0:
|
gain | Gain of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original gain of the remote user). The smaller the value, the less the gain. |
|
pure virtual |
Changes the voice pitch of the local speaker.
pitch | Sets the voice pitch. The value ranges between 0.5 and 2.0. The lower the value, the lower the voice pitch. The default value is 1.0 (no change to the local voice pitch). |
|
pure virtual |
Sets the local voice equalization effect.
bandFrequency | Sets the band frequency. The value ranges between 0 and 9, representing the respective 10-band center frequencies of the voice effects, including 31, 62, 125, 250, 500, 1k, 2k, 4k, 8k, and 16k Hz. See AUDIO_EQUALIZATION_BAND_FREQUENCY. |
bandGain | Sets the gain of each band in dB. The value ranges between -15 and 15. |
|
pure virtual |
Sets the local voice reverberation.
As of v3.2.0, the SDK provides a more convenient method setAudioEffectPreset, which directly implements the popular music, R&B music, KTV and other preset reverb effects.
reverbKey | Sets the reverberation key. See AUDIO_REVERB_TYPE. |
value | Sets the value of the reverberation key. See AUDIO_REVERB_TYPE. |
|
pure virtual |
Sets the local voice changer option.
This method can be used to set the local voice effect for users in a COMMUNICATION
channel or hosts in a LIVE_BROADCASTING
channel. Voice changer options include the following voice effects:
VOICE_CHANGER_XXX
: Changes the local voice to an old man, a little boy, or the Hulk. Applies to the voice talk scenario.VOICE_BEAUTY_XXX
: Beautifies the local voice by making it sound more vigorous, resounding, or adding spacial resonance. Applies to the voice talk and singing scenario.GENERAL_VOICE_BEAUTY_XXX
: Adds gender-based beautification effect to the local voice. Applies to the voice talk scenario.voiceChanger | Sets the local voice changer option. The default value is VOICE_CHANGER_OFF , which means the original voice. See details in VOICE_CHANGER_PRESET. |
|
pure virtual |
Sets the local voice reverberation option, including the virtual stereo.
This method sets the local voice reverberation for users in a COMMUNICATION
channel or hosts in a LIVE_BROADCASTING
channel. After successfully calling this method, all users in the channel can hear the voice with reverberation.
AUDIO_REVERB_FX
, ensure that you set profile in setAudioProfile
as AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)
or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)
; otherwise, this methods cannot set the corresponding voice reverberation option.AUDIO_VIRTUAL_STEREO
, Agora recommends setting the profile
parameter in setAudioProfile
as AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)
.setLocalVoiceChanger
, because the method called later overrides the one called earlier. For detailed considerations, see the advanced guide Set the Voice Effect.reverbPreset | The local voice reverberation option. The default value is AUDIO_REVERB_OFF , which means the original voice. See AUDIO_REVERB_PRESET. To achieve better voice effects, Agora recommends the enumeration whose name begins with AUDIO_REVERB_FX . |
|
pure virtual |
Sets an SDK preset voice beautifier effect.
Call this method to set an SDK preset voice beautifier effect for the local user who sends an audio stream. After setting a voice beautifier effect, all users in the channel can hear the effect.
You can set different voice beautifier effects for different scenarios. See Set the Voice Effect.
To achieve better audio effect quality, Agora recommends calling setAudioProfile and setting the scenario
parameter to AUDIO_SCENARIO_GAME_STREAMING(3)
and the profile
parameter to AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)
or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)
before calling this method.
profile
parameter of setAudioProfile to AUDIO_PROFILE_SPEECH_STANDARD(1)
or AUDIO_PROFILE_IOT(6)
; otherwise, this method call does not take effect.preset | The options for SDK preset voice beautifier effects: VOICE_BEAUTIFIER_PRESET. |
|
pure virtual |
Sets an SDK preset audio effect.
Call this method to set an SDK preset audio effect for the local user who sends an audio stream. This audio effect does not change the gender characteristics of the original voice. After setting an audio effect, all users in the channel can hear the effect.
You can set different audio effects for different scenarios. See Set the Voice Effect.
To achieve better audio effect quality, Agora recommends calling setAudioProfile and setting the scenario
parameter to AUDIO_SCENARIO_GAME_STREAMING(3)
before calling this method.
parameter
of setAudioProfile
to AUDIO_PROFILE_SPEECH_STANDARD(1)
or AUDIO_PROFILE_IOT(6)
; otherwise, this method call does not take effect.preset
parameter to enumerators except ROOM_ACOUSTICS_3D_VOICE
or PITCH_CORRECTION
, do not call setAudioEffectParameters; otherwise, setAudioEffectParameters
overrides this method.setAudioEffectPreset
:
preset | The options for SDK preset audio effects. See AUDIO_EFFECT_PRESET. |
|
pure virtual |
Sets an SDK preset voice conversion effect.
Call this method to set an SDK preset voice conversion effect for the local user who sends an audio stream. After setting a voice conversion effect, all users in the channel can hear the effect.
You can set different voice conversion effects for different scenarios. See Set the Voice Effect.
To achieve better voice effect quality, Agora recommends calling setAudioProfile and setting the profile
parameter to AUDIO_PROFILE_MUSIC_HIGH_QUALITY (4) or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO (5) and the scenario
parameter to AUDIO_SCENARIO_GAME_STREAMING (3) before calling this method.
profile
parameter of setAudioProfile
to AUDIO_PROFILE_SPEECH_STANDARD (1) or AUDIO_PROFILE_IOT (6); otherwise, this method call does not take effect.setVoiceConversionPreset
:
preset | The options for SDK preset voice conversion effects: VOICE_CONVERSION_PRESET. |
|
pure virtual |
Sets parameters for SDK preset audio effects.
Call this method to set the following parameters for the local user who sends an audio stream:
After setting parameters, all users in the channel can hear the relevant effect.
scenario
parameter to AUDIO_SCENARIO_GAME_STREAMING(3)
before calling this method.profile
parameter of setAudioProfile to AUDIO_PROFILE_SPEECH_STANDARD(1)
or AUDIO_PROFILE_IOT(6)
; otherwise, this method call does not take effect.setAudioEffectParameters
:
preset | The options for SDK preset audio effects:
|
param1 |
|
param2 |
|
|
pure virtual |
Sets parameters for SDK preset voice beautifier effects.
Call this method to set a gender characteristic and a reverberation effect for the singing beautifier effect. This method sets parameters for the local user who sends an audio stream.
After you call this method successfully, all users in the channel can hear the relevant effect.
To achieve better audio effect quality, before you call this method, Agora recommends calling setAudioProfile, and setting the scenario
parameter as AUDIO_SCENARIO_GAME_STREAMING(3)
and the profile
parameter as AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)
or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)
.
profile
parameter of setAudioProfile as AUDIO_PROFILE_SPEECH_STANDARD(1)
or AUDIO_PROFILE_IOT(6)
; otherwise, this method call does not take effect.setVoiceBeautifierParameters
:
preset | The options for SDK preset voice beautifier effects:
|
param1 | The gender characteristics options for the singing voice:
|
param2 | The reverberation effects options:
|
|
pure virtual |
Sets the log files that the SDK outputs.
logConfig
in the initialize method instead.By default, the SDK outputs five log files, agorasdk.log
, agorasdk_1.log
, agorasdk_2.log
, agorasdk_3.log
, agorasdk_4.log
, each with a default size of 1024 KB. These log files are encoded in UTF-8. The SDK writes the latest logs in agorasdk.log
. When agorasdk.log
is full, the SDK deletes the log file with the earliest modification time among the other four, renames agorasdk.log
to the name of the deleted log file, and create a new agorasdk.log
to record latest logs.
filePath | The absolute path of log files. The default file path is C: \Users\<user_name>\AppData\Local\Agora\<process_name>\agorasdk.log . Ensure that the directory for the log files exists and is writable. You can use this parameter to rename the log files. |
|
pure virtual |
Sets the output log level of the SDK.
logConfig
in the initialize method instead.You can use one or a combination of the log filter levels. The log level follows the sequence of OFF, CRITICAL, ERROR, WARNING, INFO, and DEBUG. Choose a level to see the logs preceding that level.
If you set the log level to WARNING, you see the logs within levels CRITICAL, ERROR, and WARNING.
filter | Sets the log filter level. See LOG_FILTER_TYPE. |
|
pure virtual |
Sets the size of a log file that the SDK outputs.
logConfig
in the initialize method instead.By default, the SDK outputs five log files, agorasdk.log
, agorasdk_1.log
, agorasdk_2.log
, agorasdk_3.log
, agorasdk_4.log
, each with a default size of 1024 KB. These log files are encoded in UTF-8. The SDK writes the latest logs in agorasdk.log
. When agorasdk.log
is full, the SDK deletes the log file with the earliest modification time among the other four, renames agorasdk.log
to the name of the deleted log file, and create a new agorasdk.log
to record latest logs.
fileSizeInKBytes | The size (KB) of a log file. The default value is 1024 KB. If you set fileSizeInKByte to 1024 KB, the SDK outputs at most 5 MB log files; if you set it to less than 1024 KB, the maximum size of a log file is still 1024 KB. |
|
pure virtual |
This method can be called multiple times during a call to change the display mode.
renderMode | Sets the local video display mode. See RENDER_MODE_TYPE. |
|
pure virtual |
Updates the display mode of the local video view.
After initializing the local video view, you can call this method to update its rendering and mirror modes. It affects only the video view that the local user sees, not the published local video stream.
renderMode | The rendering mode of the local video view. See RENDER_MODE_TYPE. |
mirrorMode |
|
|
pure virtual |
This method can be called multiple times during a call to change the display mode.
userId | ID of the remote user. |
renderMode | Sets the video display mode. See RENDER_MODE_TYPE. |
|
pure virtual |
Updates the display mode of the video view of a remote user.
userId | The ID of the remote user. |
renderMode | The rendering mode of the remote video view. See RENDER_MODE_TYPE. |
mirrorMode |
|
|
pure virtual |
Sets the local video mirror mode.
mirrorMode | Sets the local video mirror mode. See VIDEO_MIRROR_MODE_TYPE. |
|
pure virtual |
Sets the stream mode to the single-stream (default) or dual-stream mode.
If the dual-stream mode is enabled, the receiver can choose to receive the high stream (high-resolution and high-bitrate video stream), or the low stream (low-resolution and low-bitrate video stream).
enabled | Sets the stream mode:
|
|
pure virtual |
Sets the external audio source.
enabled | Sets whether to enable/disable the external audio source:
|
sampleRate | Sets the sample rate (Hz) of the external audio source, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
channels | Sets the number of audio channels of the external audio source:
|
|
pure virtual |
Sets the external audio sink. This method applies to scenarios where you want to use external audio data for playback. After enabling the external audio sink, you can call the pullAudioFrame method to pull the remote audio data, process it, and play it with the audio effects that you want.
enabled |
|
sampleRate | Sets the sample rate (Hz) of the external audio sink, which can be set as 16000, 32000, 44100 or 48000. |
channels | Sets the number of audio channels of the external audio sink:
|
|
pure virtual |
Sets the audio recording format for the onRecordAudioFrame callback.
sampleRate | Sets the sample rate (samplesPerSec ) returned in the onRecordAudioFrame callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
channel | Sets the number of audio channels (channels ) returned in the onRecordAudioFrame callback:
|
mode | Sets the use mode (see RAW_AUDIO_FRAME_OP_MODE_TYPE) of the onRecordAudioFrame callback. |
samplesPerCall | Sets the number of samples returned in the onRecordAudioFrame callback. samplesPerCall is usually set as 1024 for RTMP or RTMPS streaming. |
onRecordAudioFrame
callback according to the sample interval. Ensure that the sample interval ≥ 0.01 (s). And, Sample interval (sec) = samplePerCall
/(sampleRate
× channel
).
|
pure virtual |
Sets the audio playback format for the onPlaybackAudioFrame callback.
sampleRate | Sets the sample rate (samplesPerSec ) returned in the onPlaybackAudioFrame callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
channel | Sets the number of channels (channels ) returned in the onPlaybackAudioFrame callback:
|
mode | Sets the use mode (see RAW_AUDIO_FRAME_OP_MODE_TYPE) of the onPlaybackAudioFrame callback. |
samplesPerCall | Sets the number of samples returned in the onPlaybackAudioFrame callback. samplesPerCall is usually set as 1024 for RTMP or RTMPS streaming. |
onPlaybackAudioFrame
callback according to the sample interval. Ensure that the sample interval ≥ 0.01 (s). And, Sample interval (sec) = samplePerCall
/(sampleRate
× channel
).
|
pure virtual |
Sets the mixed audio format for the onMixedAudioFrame callback.
sampleRate | Sets the sample rate (samplesPerSec ) returned in the onMixedAudioFrame callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
samplesPerCall | Sets the number of samples (samples ) returned in the onMixedAudioFrame callback. samplesPerCall is usually set as 1024 for RTMP or RTMPS streaming. |
onMixedAudioFrame
callback according to the sample interval. Ensure that the sample interval ≥ 0.01 (s). And, Sample interval (sec) = samplePerCall
/(sampleRate
× channels
).
|
pure virtual |
Adjusts the volume of the signal captured by the microphone.
volume | The volume of the signal captured by the microphone. The value ranges between 0 and 400, including the following:
|
|
pure virtual |
Adjusts the playback signal volume of all remote users.
adjustPlaybackSignalVolume
and adjustAudioMixingVolume methods and set the volume as 0
.volume | The playback volume. The value ranges between 0 and 400, including the following:
|
|
pure virtual |
Adjusts the volume of the signal captured by the sound card.
After calling enableLoopbackRecording to enable loopback audio capturing, you can call this method to adjust the volume of the signal captured by the sound card.
volume | The volume of the signal captured by the sound card. The value ranges between 0 and 100, including the following:
|
|
pure virtual |
LIVE_BROADCASTING
profile. In the COMMUNICATION
profile, interoperability with the Agora Web SDK is enabled by default.enabled | Sets whether to enable/disable interoperability with the Agora Web SDK:
|
|
pure virtual |
LIVE_BROADCASTING
only).This method is deprecated as of v2.4.0.
preferFrameRateOverImageQuality | Sets the video quality preference:
|
|
pure virtual |
Sets the fallback option for the published video stream based on the network conditions.
If option
is set as STREAM_FALLBACK_OPTION_AUDIO_ONLY (2), the SDK will:
When the published video stream falls back to audio only or when the audio-only stream switches back to the video, the SDK triggers the onLocalPublishFallbackToAudioOnly callback.
option | Sets the fallback option for the published video stream:
|
|
pure virtual |
Sets the fallback option for the remotely subscribed video stream based on the network conditions.
The default setting for option
is STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW (1), where the remotely subscribed video stream falls back to the low-stream video (low resolution and low bitrate) under poor downlink network conditions.
If option
is set as STREAM_FALLBACK_OPTION_AUDIO_ONLY (2), the SDK automatically switches the video from a high-stream to a low-stream, or disables the video when the downlink network conditions cannot support both audio and video to guarantee the quality of the audio. The SDK monitors the network quality and restores the video stream when the network conditions improve.
When the remotely subscribed video stream falls back to audio only or when the audio-only stream switches back to the video stream, the SDK triggers the onRemoteSubscribeFallbackToAudioOnly callback.
option | Sets the fallback option for the remotely subscribed video stream. See STREAM_FALLBACK_OPTIONS. |
|
pure virtual |
Switches between front and rear cameras.
|
pure virtual |
Sets the default audio route.
If the default audio route of the SDK (see Set the Audio Route) cannot meet your requirements, you can call this method to switch the default audio route. After successfully switching the audio route, the SDK triggers the onAudioRouteChanged callback to indicate the changes.
defaultToSpeaker | Sets the default audio route as follows:
|
|
pure virtual |
Enables/Disables the audio route to the speakerphone.
If the default audio route of the SDK (see Set the Audio Route) or the setting in setDefaultAudioRouteToSpeakerphone cannot meet your requirements, you can call this method to switch the current audio route. After successfully switching the audio route, the SDK triggers the onAudioRouteChanged callback to indicate the changes.
This method only sets the audio route in the current channel and does not influence the default audio route. If the user leaves the current channel and joins another channel, the default audio route is used.
speakerOn | Sets whether to enable the speakerphone or earpiece:
|
|
pure virtual |
Enables in-ear monitoring (for Android and iOS only).
enabled | Determines whether to enable in-ear monitoring.
|
|
pure virtual |
Sets the volume of the in-ear monitor.
volume | Sets the volume of the in-ear monitor. The value ranges between 0 and 100 (default). |
|
pure virtual |
Checks whether the speakerphone is enabled.
|
pure virtual |
Sets the operational permission of the SDK on the audio session.
The SDK and the app can both configure the audio session by default. If you need to only use the app to configure the audio session, this method restricts the operational permission of the SDK on the audio session.
You can call this method either before or after joining a channel. Once you call this method to restrict the operational permission of the SDK on the audio session, the restriction takes effect when the SDK needs to change the audio session.
restriction | The operational permission of the SDK on the audio session. See AUDIO_SESSION_OPERATION_RESTRICTION. This parameter is in bit mask format, and each bit corresponds to a permission. |
|
pure virtual |
Enables loopback audio capturing.
If you enable loopback audio capturing, the output of the sound card is mixed into the audio stream sent to the other end.
deviceName
parameter. Agora recommends that you use AgoraALD (Agora Audio Loopback Device) and pass in "AgoraALD"
.enabled | Sets whether to enable/disable loopback capturing.
|
deviceName | The device name of the sound card. The default is set to null, which means the SDK uses the current sound card to capture. If you are using a virtual sound card, such as AgoraALD (Agora Audio Loopback Device), set this parameter as the name of the sound card ("AgoraALD" ). |
|
pure virtual |
Gets a list of shareable screens and windows.
You can call this method before sharing a screen or window to get a list of shareable screens and windows, which enables a user to use thumbnails in the list to easily choose a particular screen or window to share. This list also contains important information such as window ID and screen ID, with which you can call startScreenCaptureByWindowId or startScreenCaptureByDisplayId to start the sharing.
thumbSize | The target size of the screen or window thumbnail. The width and height are in pixels. See SIZE. The SDK scales the original image to make the length of the longest side of the image the same as that of the target size without distorting the original image. For example, if the original image is 400 × 300 and thumbSize is 100 × 100, the actual size of the thumbnail is 100 × 75. If the target size is larger than the original size, the thumbnail is the original image and the SDK does not scale it. |
iconSize | The target size of the icon corresponding to the application program. The width and height are in pixels. See SIZE. The SDK scales the original image to make the length of the longest side of the image the same as that of the target size without distorting the original image. For example, if the original image is 400 × 300 and iconSize is 100 × 100, the actual size of the icon is 100 × 75. If the target size is larger than the original size, the icon is the original image and the SDK does not scale it. |
includeScreen | Whether the SDK returns screen information in addition to window information:
|
|
pure virtual |
Shares the whole or part of a screen by specifying the display ID.
displayId | The display ID of the screen to be shared. Use this parameter to specify which screen you want to share. For more information on how to get the display ID, see the advanced feature guide Share the Screen or get the display ID from sourceId returned by getScreenCaptureSources. |
regionRect | (Optional) Sets the relative location of the region to the screen. NIL means sharing the whole screen. See Rectangle. If the specified region overruns the screen, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen. |
captureParams | The screen sharing encoding parameters. The default video dimension is 1920 x 1080, that is, 2,073,600 pixels. Agora uses the value of videoDimension to calculate the charges. For details, see descriptions in ScreenCaptureParameters. |
|
pure virtual |
Shares the whole or part of a screen by specifying the screen rect.
startScreenCaptureByDisplayId
if you need to start screen sharing on a device connected to another display.screenRect | Sets the relative location of the screen to the virtual screen. For information on how to get screenRect, see the advanced guide Share Screen. |
regionRect | (Optional) Sets the relative location of the region to the screen. NULL means sharing the whole screen. See Rectangle. If the specified region overruns the screen, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen. |
captureParams | The screen sharing encoding parameters. The default video dimension is 1920 x 1080, that is, 2,073,600 pixels. Agora uses the value of videoDimension to calculate the charges. For details, see descriptions in ScreenCaptureParameters. |
|
pure virtual |
Shares the whole or part of a window by specifying the window ID.
As of v3.7.0, the window sharing feature supports most UWP (Universal Windows Platform) applications windows. The details of the support are as follows:
Device system | Application | Support or not |
---|---|---|
Windows 10 | Chrome, Microsoft Office, WPS Office, Windows Media Player and other mainstream applications | Yes |
Windows 8 | Chrome, Microsoft Office, WPS Office, Windows Media Player and other mainstream applications | Yes |
Windows 7 | Microsoft Office, WPS PPT (11.1.0.9098) | Yes |
Windows 7 | Chrome, Windows Media Player, WPS Word (11.1.0.9098), WPS Excel (11.1.0.9098) | No |
windowId | The ID of the window to be shared. For information on how to get the windowId, see the advanced guide Share Screen. |
regionRect | (Optional) The relative location of the region to the window. NULL/NIL means sharing the whole window. See Rectangle. If the specified region overruns the window, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole window. |
captureParams | The screen sharing encoding parameters. The default video dimension is 1920 x 1080, that is, 2,073,600 pixels. Agora uses the value of videoDimension to calculate the charges. For details, see descriptions in ScreenCaptureParameters. |
|
pure virtual |
Sets the content hint for screen sharing.
A content hint suggests the type of the content being shared, so that the SDK applies different optimization algorithm to different types of content.
contentHint | Sets the content hint for screen sharing. See VideoContentHint. |
|
pure virtual |
Sets the screen sharing scenario.
When you start screen sharing or window sharing, you can call this method to set the screen sharing scenario. The SDK adjusts the video quality and experience of the sharing according to the scenario.
screenScenario | The screen sharing scenario. See SCREEN_SCENARIO_TYPE. |
|
pure virtual |
Updates the screen sharing parameters.
captureParams | The screen sharing encoding parameters. The default video dimension is 1920 x 1080, that is, 2,073,600 pixels. Agora uses the value of videoDimension to calculate the charges. For details, see descriptions in ScreenCaptureParameters. |
|
pure virtual |
Updates the screen sharing region.
regionRect | Sets the relative location of the region to the screen or window. NULL means sharing the whole screen or window. See Rectangle. If the specified region overruns the screen or window, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen or window. |
|
pure virtual |
Stop screen sharing.
|
pure virtual |
This method is deprecated as of v2.4.0. See the following methods instead:
This method shares the whole screen, specified window, or specified region:
windowId
as 0 and rect
as NULL.windowId
as a value other than 0. Each window has a windowId
that is not 0.windowId
as 0 and rect
not as NULL. In this case, you can share the specified region, for example by dragging the mouse or implementing your own logic.windowId | Sets the screen sharing area. See WindowIDType. |
captureFreq | (Mandatory) The captured frame rate. The value ranges between 1 fps and 15 fps. |
rect | Specifies the screen-sharing region. rect is valid when windowsId is set as 0. When rect is set as NULL, the whole screen is shared. |
bitrate | The captured bitrate. |
|
pure virtual |
rect | Specifies the required region inside the screen or window. |
|
pure virtual |
Sets a custom video source.
During real-time communication, the Agora SDK enables the default video input device, that is, the built-in camera to capture video. If you need a custom video source, implement the IVideoSource class first, and call this method to add the custom video source to the SDK.
source | The custom video source. See IVideoSource. |
|
pure virtual |
Gets the current call ID.
When a user joins a channel on a client, a callId
is generated to identify the call from the client. Feedback methods, such as rate and complain, must be called after the call ends to submit feedback to the SDK.
The rate and complain methods require the callId
parameter retrieved from the getCallId method during a call. callId
is passed as an argument into the rate and complain methods after the call ends.
callId | Pointer to the current call ID. |
|
pure virtual |
Allows a user to rate a call after the call ends.
callId | Pointer to the ID of the call, retrieved from the getCallId method. |
rating | Rating of the call. The value is between 1 (lowest score) and 5 (highest score). If you set a value out of this range, the ERR_INVALID_ARGUMENT (2) error returns. |
description | (Optional) Pointer to the description of the rating, with a string length of less than 800 bytes. |
|
pure virtual |
Allows a user to complain about the call quality after a call ends.
callId | Pointer to the ID of the call, retrieved from the getCallId method. |
description | (Optional) Pointer to the description of the complaint, with a string length of less than 800 bytes. |
|
pure virtual |
Gets the SDK version number.
build | Pointer to the build number. |
|
pure virtual |
Enables the network connection quality test.
This method tests the quality of the users' network connections and is disabled by default.
Before a user joins a channel or before an audience switches to a host, call this method to check the uplink network quality.
This method consumes additional network traffic, and hence may affect communication quality.
Call the disableLastmileTest method to disable this test after receiving the onLastmileQuality callback, and before joining a channel.
disableLastmileTest
method or not, the SDK automatically stops consuming the bandwidth.
|
pure virtual |
Disables the network connection quality test.
|
pure virtual |
Starts the last-mile network probe test.
This method starts the last-mile network probe test before joining a channel to get the uplink and downlink last mile network statistics, including the bandwidth, packet loss, jitter, and round-trip time (RTT).
Call this method to check the uplink network quality before users join a channel or before an audience switches to a host. Once this method is enabled, the SDK returns the following callbacks:
LIVE_BROADCASTING
profile, a host should not call this method after joining a channel.config | Sets the configurations of the last-mile network probe test. See LastmileProbeConfig. |
|
pure virtual |
Stops the last-mile network probe test.
|
pure virtual |
Gets the warning or error description.
|
pure virtual |
Enables built-in encryption with an encryption password before users join a channel.
All users in a channel must use the same encryption password. The encryption password is automatically cleared once a user leaves the channel.
If an encryption password is not specified, the encryption functionality will be disabled.
secret | Pointer to the encryption password. |
|
pure virtual |
Sets the built-in encryption mode.
The Agora SDK supports built-in encryption, which is set to the aes-128-xts
mode by default. Call this method to use other encryption modes.
All users in the same channel must use the same encryption mode and password.
Refer to the information related to the AES encryption algorithm on the differences between the encryption modes.
encryptionMode | Pointer to the set encryption mode:
|
|
pure virtual |
Enables/Disables the built-in encryption.
In scenarios requiring high security, Agora recommends calling this method to enable the built-in encryption before joining a channel.
After a user leaves the channel, the SDK automatically disables the built-in encryption. To re-enable the built-in encryption, call this method before the user joins the channel again.
As of v3.4.5, Agora recommends using either the AES_128_GCM2
or AES_256_GCM2
encryption mode, both of which support adding a salt and are more secure. For details, see Media Stream Encryption.
enabled | Whether to enable the built-in encryption:
|
config | Configurations of built-in encryption schemas. See EncryptionConfig. |
IRtcEngine
instance before calling this method.
|
pure virtual |
Registers a packet observer.
The Agora SDK allows your application to register a packet observer to receive callbacks for voice or video packet transmission.
observer | Pointer to the registered packet observer. See IPacketObserver. |
|
pure virtual |
Creates a data stream.
Each user can create up to five data streams during the lifecycle of the IRtcEngine.
reliable
as true
while setting ordered
as false
.[out] | streamId | Pointer to the ID of the created data stream. |
reliable | Sets whether or not the recipients are guaranteed to receive the data stream from the sender within five seconds:
| |
ordered | Sets whether or not the recipients receive the data stream in the sent order:
|
|
pure virtual |
Creates a data stream.
Each user can create up to five data streams in a single channel.
This method does not support data reliability. If the receiver receives a data packet five seconds or more after it was sent, the SDK directly discards the data.
[out] | streamId | The ID of the created data stream. |
config | The configurations for the data stream: DataStreamConfig. |
|
pure virtual |
Sends data stream messages to all users in a channel.
The SDK has the following restrictions on this method:
A successful sendStreamMessage method call triggers the onStreamMessage callback on the remote client, from which the remote user gets the stream message.
A failed sendStreamMessage method call triggers the onStreamMessage callback on the remote client.
COMMUNICATION
profile or to the hosts in the LIVE_BROADCASTING
profile. If an audience in the LIVE_BROADCASTING
profile calls this method, the audience may be switched to a host. streamId | ID of the sent data stream, returned in the createDataStream method. |
data | Pointer to the sent data. |
length | Length of the sent data. |
|
pure virtual |
Publishes the local stream to a specified CDN live address. (CDN live only.)
The SDK returns the result of this method call in the onStreamPublished callback.
The addPublishStreamUrl method call triggers the onRtmpStreamingStateChanged callback on the local client to report the state of adding a local stream to the CDN.
LIVE_BROADCASTING
only.url | The CDN streaming URL in the RTMP or RTMPS format. The maximum length of this parameter is 1024 bytes. The CDN streaming URL must not contain special characters, such as Chinese language characters. |
transcodingEnabled | Sets whether transcoding is enabled/disabled:
|
|
pure virtual |
Removes an RTMP or RTMPS stream from the CDN. (CDN live only.)
This method removes the CDN streaming URL (added by the addPublishStreamUrl method) from a CDN live stream. The SDK returns the result of this method call in the onStreamUnpublished callback.
The removePublishStreamUrl method call triggers the onRtmpStreamingStateChanged callback on the local client to report the state of removing an RTMP or RTMPS stream from the CDN.
LIVE_BROADCASTING
only.url | The CDN streaming URL to be removed. The maximum length of this parameter is 1024 bytes. |
|
pure virtual |
Sets the video layout and audio settings for CDN live. (CDN live only.)
The SDK triggers the onTranscodingUpdated callback when you call the setLiveTranscoding
method to update the transcoding setting.
LIVE_BROADCASTING
only.setLiveTranscoding
method to update the transcoding setting for the first time, the SDK does not trigger the onTranscodingUpdated
callback.transcoding | Sets the CDN live audio/video transcoding settings. See LiveTranscoding. |
|
pure virtual |
Starts pushing media streams to a CDN without transcoding.
You can call this method to push a live audio-and-video stream to the specified CDN address. This method can push media streams to only one CDN address at a time, so if you need to push streams to multiple addresses, call this method multiple times.
After you call this method, the SDK triggers the onRtmpStreamingStateChanged callback on the local client to report the state of the streaming.
LIVE_BROADCASTING
profile can call this method.url | The address of the CDN live streaming. The format is RTMP or RTMPS. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported. |
ERR_INVALID_ARGUMENT(-2)
: url is null or the string length is 0.ERR_NOT_INITIALIZED(-7)
: The SDK is not initialized before calling this method.
|
pure virtual |
Starts pushing media streams to a CDN and sets the transcoding configuration.
You can call this method to push a live audio-and-video stream to the specified CDN address and set the transcoding configuration. This method can push media streams to only one CDN address at a time, so if you need to push streams to multiple addresses, call this method multiple times.
After you call this method, the SDK triggers the onRtmpStreamingStateChanged callback on the local client to report the state of the streaming.
LIVE_BROADCASTING
profile can call this method.url | The address of the CDN live streaming. The format is RTMP or RTMPS. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported. |
transcoding | The transcoding configuration for CDN live streaming. See LiveTranscoding. |
ERR_INVALID_ARGUMENT(-2)
: url is null or the string length is 0.ERR_NOT_INITIALIZED(-7)
: The SDK is not initialized before calling this method.
|
pure virtual |
Updates the transcoding configuration.
After you start pushing media streams to CDN with transcoding, you can dynamically update the transcoding configuration according to the scenario. The SDK triggers the onTranscodingUpdated callback after the transcoding configuration is updated.
transcoding | The transcoding configuration for CDN live streaming. See LiveTranscoding. |
|
pure virtual |
Stops pushing media streams to a CDN.
You can call this method to stop the live stream on the specified CDN address. This method can stop pushing media streams to only one CDN address at a time, so if you need to stop pushing streams to multiple addresses, call this method multiple times.
After you call this method, the SDK triggers the onRtmpStreamingStateChanged callback on the local client to report the state of the streaming.
url | The address of the CDN live streaming. The format is RTMP or RTMPS. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported. |
|
pure virtual |
This method is deprecated from v2.9.1. Use addVideoWatermark [2/2] instead.
This method adds a PNG watermark image to the local video stream for the capturing device, channel audience, and CDN live audience to view and capture.
To add the PNG file to the CDN live publishing stream, see the setLiveTranscoding method.
watermark | Pointer to the watermark image to be added to the local video stream. See RtcImage. |
|
pure virtual |
Adds a watermark image to the local video.
This method adds a PNG watermark image to the local video in the live streaming. Once the watermark image is added, all the audience in the channel (CDN audience included), and the capturing device can see and capture it. Agora supports adding only one watermark image onto the local video, and the newly watermark image replaces the previous one.
The watermark position depends on the settings in the setVideoEncoderConfiguration method:
setVideoEncoderConfiguration
method. Otherwise, the watermark image will be cropped.visibleInPreview
member in the WatermarkOptions class to set whether or not the watermark is visible in preview.watermarkUrl | The local file path of the watermark image to be added. This method supports adding a watermark image from the local absolute or relative file path. On Android, Agora recommends passing a URI address or the path starts with /assets/ in this parameter |
options | Pointer to the watermark's options to be added. See WatermarkOptions for more infomation. |
|
pure virtual |
Removes the watermark image from the video stream added by the addVideoWatermark method.
|
pure virtual |
Enables/Disables image enhancement and sets the options.
libagora_video_process_extension.so
AgoraVideoProcessExtension.xcframework
libagora_video_process_extension.dll
enabled | Determines whether to enable image enhancement:
|
options | The image enhancement option. See BeautyOptions. |
-4(ERR_NOT_SUPPORTED)
: The system version is earlier than Android 5.0, which does not support this function.
|
pure virtual |
Sets low-light enhancement.
The low-light enhancement feature can adaptively adjust the brightness value of the video captured in situations with low or uneven lighting, such as backlit, cloudy, or dark scenes. It restores or highlights the image details and improves the overall visual effect of the video.
You can call this method to enable the low-light enhancement feature and set the options of the low-light enhancement effect.
libagora_segmentation_extension.so
AgoraVideoSegmentationExtension.xcframework
libagora_segmentation_extension.dll
enabled | Sets whether to enable low-light enhancement:
|
options | The low-light enhancement options. See LowLightEnhanceOptions. |
|
pure virtual |
Sets video noise reduction.
Underlit environments and low-end video capture devices can cause video images to contain significant noise, which affects video quality. In real-time interactive scenarios, video noise also consumes bitstream resources and reduces encoding efficiency during encoding.
You can call this method to enable the video noise reduction feature and set the options of the video noise reduction effect.
libagora_segmentation_extension.so
AgoraVideoSegmentationExtension.xcframework
libagora_segmentation_extension.dll
enabled | Sets whether to enable video noise reduction:
|
options | The video noise reduction options. See VideoDenoiserOptions. |
|
pure virtual |
Sets color enhancement.
The video images captured by the camera can have color distortion. The color enhancement feature intelligently adjusts video characteristics such as saturation and contrast to enhance the video color richness and color reproduction, making the video more vivid.
You can call this method to enable the color enhancement feature and set the options of the color enhancement effect.
libagora_segmentation_extension.so
AgoraVideoSegmentationExtension.xcframework
libagora_segmentation_extension.dll
enabled | Sets whether to enable color enhancement:
|
options | The color enhancement options. See ColorEnhanceOptions. |
|
pure virtual |
Enables/Disables the virtual background.
Support for macOS and Windows as of v3.4.5 and Android and iOS as of v3.5.0.
After enabling the virtual background feature, you can replace the original background image of the local user with a custom background image. After the replacement, all users in the channel can see the custom background image. You can find out from the onVirtualBackgroundSourceEnabled callback whether the virtual background is successfully enabled or the cause of any errors.
libagora_segmentation_extension.so
AgoraVideoSegmentationExtension.xcframework
libagora_segmentation_extension.dll
enabled | Sets whether to enable the virtual background:
|
backgroundSource | The custom background image. See VirtualBackgroundSource. Note: To adapt the resolution of the custom background image to the resolution of the SDK capturing video, the SDK scales and crops the custom background image while ensuring that the content of the custom background image is not distorted. |
|
pure virtual |
Starts to relay media streams across channels.
After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged and onChannelMediaRelayEvent callbacks, and these callbacks return the state and events of the media stream relay.
LIVE_BROADCASTING
channel.configuration | The configuration of the media stream relay: ChannelMediaRelayConfiguration. |
|
pure virtual |
Updates the channels for media stream relay. After a successful startChannelMediaRelay method call, if you want to relay the media stream to more channels, or leave the current relay channel, you can call the updateChannelMediaRelay method.
After a successful method call, the SDK triggers the onChannelMediaRelayEvent callback with the RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL (7) state code.
configuration | The media stream relay configuration: ChannelMediaRelayConfiguration. |
|
pure virtual |
Pauses the media stream relay to all destination channels.
After the cross-channel media stream relay starts, you can call this method to pause relaying media streams to all destination channels; after the pause, if you want to resume the relay, call resumeAllChannelMediaRelay.
After a successful method call, the SDK triggers the onChannelMediaRelayEvent callback to report whether the media stream relay is successfully paused.
|
pure virtual |
Resumes the media stream relay to all destination channels.
After calling the pauseAllChannelMediaRelay method, you can call this method to resume relaying media streams to all destination channels.
After a successful method call, the SDK triggers the onChannelMediaRelayEvent callback to report whether the media stream relay is successfully resumed.
|
pure virtual |
Stops the media stream relay.
Once the relay stops, the host quits all the destination channels.
After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged callback. If the callback returns RELAY_STATE_IDLE (0) and RELAY_OK (0), the host successfully stops the relay.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Agora supports reporting and analyzing customized messages.
This function is in the beta stage with a free trial. The ability provided in its beta test version is reporting a maximum of 10 message pieces within 6 seconds, with each message piece not exceeding 256 bytes and each string not exceeding 100 bytes. To try out this function, contact support@agora.io and discuss the format of customized messages with us.
|
pure virtual |
Gets the current connection state of the SDK.
|
pure virtual |
Enables/Disables the super resolution feature for a remote user's video. (beta feature)
This feature effectively boosts the resolution of a remote user's video seen by the local user. If the original resolution of a remote user's video is a × b, the local user's device can render the remote video at a resolution of 2a × 2b after you enable this feature.
After calling this method, the SDK triggers the onUserSuperResolutionEnabled callback to report whether you have successfully enabled super resolution.
libagora_super_resolution_extension.so
AgoraSuperResolutionExtension.xcframework
userId | The user ID of the remote user. |
enable | Determines whether to enable super resolution for the remote user's video:
|
-157 (ERR_MODULE_NOT_FOUND)
: The dynamic library for super resolution is not integrated.
|
pure virtual |
Enables/Disables the super-resolution feature for a remote user's video stream. This is a beta feature.
This feature effectively boosts the resolution of a remote user's video seen by the local user. If the original resolution of a remote user's video is a × b, the local user's device can render the remote video at a resolution of 2a × 2b after you enable this feature.
After calling this method, the SDK triggers the onUserSuperResolutionEnabled callback to report whether you have successfully enabled super resolution.
libagora_super_resolution_extension.so
AgoraSuperResolutionExtension.xcframework
libagora_super_resolution_extension.dll
enabled | Determines whether to enable super resolution for the remote user's video:
|
mode | The mode of super resolution. See SR_MODE. |
userId | The user ID of the remote user. This parameter only applies when mode is set as SR_MODE_MANUAL(0) . |
-157 (ERR_MODULE_NOT_FOUND)
: The dynamic library for super resolution is not integrated.
|
pure virtual |
This method enables you to add synchronized metadata in the video stream for more diversified interactive live streaming, such as sending shopping links, digital coupons, and online quizzes.
observer | The IMetadataObserver class. See the definition of IMetadataObserver for details. |
type | See METADATA_TYPE. The SDK supports VIDEO_METADATA (0) only for now. |
|
pure virtual |
Provides technical preview functionalities or special customizations by configuring the SDK with JSON options.
The JSON options are not public by default. Agora is working on making commonly used JSON options public in a standard way.
parameters | Sets the parameter as a JSON string in the specified format. |
|
pure virtual |
Customizes the local video renderer.
During a real-time audio and video interaction, the Agora SDK enables the default renderer to render local video. If you want to customize the local video rendering, you can first customize the video renderer via the IVideoSink class, and then call this method to use the custom video renderer to render the local video.
videoSink | The custom video renderer. See IVideoSink. |
|
pure virtual |
Customizes the remote video renderer.
During a real-time audio and video interaction, the Agora SDK enables the default renderer to render remote video. If you want to customize the remote video rendering, you can first customize the video renderer via the IVideoSink class, and then call this method to use the custom video renderer to render the remote video.
uid | The user ID of the remote user. |
videoSink | The custom video renderer. See IVideoSink. |
|
pure virtual |
Sets whether to enable the flash.
setCameraTorchOn
due to system issues.isOn | Determines whether to enable the flash:
|
|
pure virtual |
Checks whether the device supports enabling the flash.
The SDK uses the front camera by default, so if you call isCameraTorchSupported
directly, you can find out from the return value whether the device supports enabling the flash when using the front camera. If you want to check whether the device supports enabling the flash when using the rear camera, call switchCamera to switch the camera used by the SDK to the rear camera, and then call isCameraTorchSupported
.
isCameraTorchSupported
returns true, you might fail to successfully enable the flash by calling setCameraTorchOn due to system issues.
|
pure virtual |
Sets the camera zoom ratio.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
factor | Sets the camera zoom factor. The value ranges between 1.0 and the maximum zoom supported by the device. |
|
pure virtual |
Gets the maximum zoom ratio supported by the camera.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
|
pure virtual |
Checks whether the camera zoom function is supported.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
|
pure virtual |
Checks whether the camera manual focus function is supported.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
|
pure virtual |
Checks whether the camera exposure function is supported.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
|
pure virtual |
Checks whether the camera auto-face focus function is supported.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
|
pure virtual |
Sets the camera manual focus position.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
A successful setCameraFocusPositionInPreview method call triggers the onCameraFocusAreaChanged
callback on the local client.
positionX | The horizontal coordinate of the touch point in the view. |
positionY | The vertical coordinate of the touch point in the view. |
|
pure virtual |
Sets the camera exposure position.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
A successful setCameraExposurePosition method call triggers the onCameraExposureAreaChanged
callback on the local client.
positionXinView | The horizontal coordinate of the touch point in the view. |
positionYinView | The vertical coordinate of the touch point in the view. |
|
pure virtual |
Sets whether to enable face autofocus.
The SDK disables face autofocus by default. To set face autofocus, call this method.
enabled | Determines whether to enable face autofocus:
|
|
pure virtual |
Takes a snapshot of a video stream.
This method takes a snapshot of a video stream from the specified user, generates a JPG image, and saves it to the specified path.
The method is asynchronous, and the SDK has not taken the snapshot when the method call returns. After a successful method call, the SDK triggers the onSnapshotTaken callback to report whether the snapshot is successfully taken as well as the details of the snapshot taken.
channel | The channel name. |
uid | The user ID of the user. Set uid as 0 if you want to take a snapshot of the local user's video. |
filePath | The local path (including the filename extensions) of the snapshot. For example, C:\Users\<user_name>\AppData\Local\Agora\<process_name>\example.jpg on Windows, /App Sandbox/Library/Caches/example.jpg on iOS, ~/Library/Logs/example.jpg on macOS, and /storage/emulated/0/Android/data/<package name>/files/example.jpg on Android. Ensure that the path you specify exists and is writable. |