Inherits IRtcEngineNative.

Public Member Functions

int SetChannelProfile (CHANNEL_PROFILE profile)
 
int SetClientRole (CLIENT_ROLE role)
 
int SetLogFilter (LOG_FILTER filter)
 
int SetLogFile (string filePath)
 
int JoinChannel (string channelName, string info, uint uid)
 
int JoinChannelByKey (string channelKey, string channelName, string info, uint uid)
 
int RenewToken (string token)
 
int LeaveChannel ()
 
int SetParameters (string parameters)
 
string GetCallId ()
 
int Rate (string callId, int rating, string desc)
 
int Complain (string callId, string desc)
 
int EnableAudio ()
 
int DisableAudio ()
 
int MuteLocalAudioStream (bool mute)
 
int MuteAllRemoteAudioStreams (bool mute)
 
int MuteRemoteAudioStream (uint uid, bool mute)
 
int SetEnableSpeakerphone (bool speakerphone)
 
int SetDefaultAudioRouteToSpeakerphone (bool speakerphone)
 
bool IsSpeakerphoneEnabled ()
 
int SwitchCamera ()
 
int SetVideoProfile (VIDEO_PROFILE_TYPE profile, bool swapWidthAndHeight)
 
int MuteLocalVideoStream (bool mute)
 
int MuteAllRemoteVideoStreams (bool mute)
 
int MuteRemoteVideoStream (uint uid, bool mute)
 
int EnableDualStreamMode (bool enabled)
 
int SetEncryptionMode (string encryptionMode)
 
int SetEncryptionSecret (string secret)
 
int CreateDataStream (bool reliable, bool ordered)
 
int SendStreamMessage (int streamId, string data)
 
int SetSpeakerphoneVolume (int volume)
 
int SetVideoQualityParameters (bool preferFrameRateOverImageQuality)
 
int StartEchoTest ()
 
int StartEchoTest (int intervalInSeconds)
 
int StopEchoTest ()
 
int StartLastmileProbeTest (LastmileProbeConfig lastmileProbeConfig)
 
int StopLastmileProbeTest ()
 
int AddVideoWatermark (RtcImage rtcImage)
 
int AddVideoWatermark (string watermarkUrl, WatermarkOptions watermarkOptions)
 
int ClearVideoWatermarks ()
 
int SetRemoteVideoStreamType (uint uid, REMOTE_VIDEO_STREAM_TYPE streamType)
 
int SetMixedAudioFrameParameters (int sampleRate, int samplesPerCall)
 
int SetAudioMixingPosition (int pos)
 
int EnableAudioVolumeIndication (int interval, int smooth, bool report_vad)
 
int AdjustRecordingSignalVolume (int volume)
 
int AdjustPlaybackSignalVolume (int volume)
 
int StartAudioMixing (string filePath, bool loopback, bool replace, int cycle)
 
int StopAudioMixing ()
 
int PauseAudioMixing ()
 
int ResumeAudioMixing ()
 
int AdjustAudioMixingVolume (int volume)
 
int GetAudioMixingDuration ()
 
int GetAudioMixingCurrentPosition ()
 
int StartAudioRecording (string filePath, AUDIO_RECORDING_QUALITY_TYPE quality)
 
int StartAudioRecording (string filePath, int sampleRate, AUDIO_RECORDING_QUALITY_TYPE quality)
 
int StopAudioRecording ()
 
IAudioEffectManager GetAudioEffectManager ()
 
IAudioRecordingDeviceManager GetAudioRecordingDeviceManager ()
 
IAudioPlaybackDeviceManager GetAudioPlaybackDeviceManager ()
 
IVideoDeviceManager GetVideoDeviceManager ()
 
IAudioRawDataManager GetAudioRawDataManager ()
 
IVideoRawDataManager GetVideoRawDataManager ()
 
int EnableVideo ()
 
int DisableVideo ()
 
int EnableLocalVideo (bool enabled)
 
int EnableLocalAudio (bool enabled)
 
int StartPreview ()
 
int StopPreview ()
 
int EnableVideoObserver ()
 
int DisableVideoObserver ()
 
int SetDefaultMuteAllRemoteAudioStreams (bool mute)
 
int SetDefaultMuteAllRemoteVideoStreams (bool mute)
 
int EnableLastmileTest ()
 
int DisableLastmileTest ()
 
CONNECTION_STATE_TYPE GetConnectionState ()
 
int SetAudioProfile (AUDIO_PROFILE_TYPE audioProfile, AUDIO_SCENARIO_TYPE scenario)
 
int SetVideoEncoderConfiguration (VideoEncoderConfiguration configuration)
 
int AdjustAudioMixingPlayoutVolume (int volume)
 
int AdjustAudioMixingPublishVolume (int volume)
 
int SetVolumeOfEffect (int soundId, int volume)
 
int SetRecordingAudioFrameParameters (int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall)
 
int SetPlaybackAudioFrameParameters (int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall)
 
int SetLocalPublishFallbackOption (STREAM_FALLBACK_OPTIONS option)
 
int SetRemoteSubscribeFallbackOption (STREAM_FALLBACK_OPTIONS option)
 
int SetRemoteDefaultVideoStreamType (REMOTE_VIDEO_STREAM_TYPE remoteVideoStreamType)
 
int AddPublishStreamUrl (string url, bool transcodingEnabled)
 
int RemovePublishStreamUrl (string url)
 
int EnableWebSdkInteroperability (bool enabled)
 
int SetLiveTranscoding (LiveTranscoding transcoding)
 
int PushVideoFrame (ExternalVideoFrame externalVideoFrame)
 
int SetExternalVideoSource (bool enable, bool useTexture)
 
int SetExternalAudioSource (bool enabled, int sampleRate, int channels)
 
int PushAudioFrame (AudioFrame audioFrame)
 
int GetAudioMixingPlayoutVolume ()
 
int GetAudioMixingPublishVolume ()
 
int EnableSoundPositionIndication (bool enabled)
 
int SetLocalVoiceChanger (VOICE_CHANGER_PRESET voiceChanger)
 
int SetLocalVoiceReverbPreset (AUDIO_REVERB_PRESET audioReverbPreset)
 
int SetLocalVoicePitch (double pitch)
 
int SetLocalVoiceEqualization (AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, int bandGain)
 
int SetLocalVoiceReverb (AUDIO_REVERB_TYPE reverbKey, int value)
 
int SetCameraCapturerConfiguration (CameraCapturerConfiguration cameraCaptureConfiguration)
 
int SetRemoteUserPriority (uint uid, PRIORITY_TYPE userPriority)
 
int SetLogFileSize (uint fileSizeInKBytes)
 
int SetExternalAudioSink (bool enabled, int sampleRate, int channels)
 
int RegisterLocalUserAccount (string appId, string userAccount)
 
int JoinChannelWithUserAccount (string token, string channelId, string userAccount)
 
UserInfo GetUserInfoByUserAccount (string account)
 
UserInfo GetUserInfoByUid (uint uid)
 
int SetBeautyEffectOptions (bool enabled, BeautyOptions beautyOptions)
 
int StartScreenCaptureByDisplayId (uint displayId, Rectangle rectangle, ScreenCaptureParameters screenCaptureParameters)
 
int StartScreenCaptureByScreenRect (Rectangle screenRectangle, Rectangle regionRectangle, ScreenCaptureParameters screenCaptureParameters)
 
int SetScreenCaptureContentHint (VideoContentHint videoContentHint)
 
int UpdateScreenCaptureParameters (ScreenCaptureParameters screenCaptureParameters)
 
int UpdateScreenCaptureRegion (Rectangle rectangle)
 
int StopScreenCapture ()
 
int AddInjectStreamUrl (string url, InjectStreamConfig streamConfig)
 
int RemoveInjectStreamUrl (string url)
 
int EnableLoopbackRecording (bool enabled, string deviceName)
 
int SetAudioSessionOperationRestriction (AUDIO_SESSION_OPERATION_RESTRICTION restriction)
 
int StartChannelMediaRelay (ChannelMediaRelayConfiguration mediaRelayConfiguration)
 
int UpdateChannelMediaRelay (ChannelMediaRelayConfiguration mediaRelayConfiguration)
 
int StopChannelMediaRelay ()
 
int SwitchChannel (string token, string channelId)
 
int SetMirrorApplied (bool wheatherApply)
 
int SetInEarMonitoringVolume (int volume)
 
int StartScreenCaptureByWindowId (int windowId, Rectangle regionRect, ScreenCaptureParameters screenCaptureParameters)
 
int EnableInEarMonitoring (bool enabled)
 

Static Public Member Functions

static string GetSdkVersion ()
 
static string GetErrorDescription (int code)
 
static IRtcEngine GetEngine (string appId)
 
static IRtcEngine getEngine (string appId)
 
static void Destroy ()
 

Detailed Description

The definition of IRtcEngine.

Member Function Documentation

◆ GetSdkVersion()

static string agora_gaming_rtc.IRtcEngine.GetSdkVersion ( )
static

Gets the SDK version.

Returns
The version of the current SDK in the string format. For example, 2.9.1.

◆ SetChannelProfile()

int agora_gaming_rtc.IRtcEngine.SetChannelProfile ( CHANNEL_PROFILE  profile)

Sets the channel profile.

The SDK needs to know the application scenario to set the appropriate channel profile to apply different optimization methods.

Note
  • This method applies only to the Live-broadcast profile.
  • Users in the same channel must use the same channel profile.
  • Before calling this method to set a new channel profile, Destroy the current engine and create a new engine using GetEngine.
  • Call this method before a user joins a channel because you cannot configure the channel profile when the channel is in use.
  • The Agora RTC SDK supports encoding only in raw data, not in texture.
Parameters
profileSets the channel profile. See CHANNEL_PROFILE.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetClientRole()

int agora_gaming_rtc.IRtcEngine.SetClientRole ( CLIENT_ROLE  role)

Sets the role of the user, such as a host or an audience (default), before joining a channel in a live broadcast.

This method can be used to switch the user role in a live broadcast after the user joins a channel.

In the Live Broadcast profile, when a user switches user roles after joining a channel, a successful setClientRole method call triggers the following callbacks:

Note
This method applies only to the Live-broadcast profile.
Parameters
roleSets the role of the user. See CLIENT_ROLE.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetLogFilter()

int agora_gaming_rtc.IRtcEngine.SetLogFilter ( LOG_FILTER  filter)

Sets the output log level of the SDK.

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.

For example, when you set the log level to WARNING, you can see the logs within levels CRITICAL, ERROR, and WARNING.

Parameters
filterSets the log filter level. See LOG_FILTER.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetLogFile()

int agora_gaming_rtc.IRtcEngine.SetLogFile ( string  filePath)

Specifies an SDK output log file.

The log file records all SDK operations during runtime. If it does not exist, the SDK creates one.

Note
  • The default log file is located at: C:\Users<user_name>\AppData\Local\Agora<process_name>.
  • Ensure that you call this method immediately after calling the GetEngine method, otherwise the output log may not be complete.
Parameters
filePathFile path of the log file. The string of the log file is in UTF-8.
Returns
  • 0: Success.
  • < 0: Failure.

◆ JoinChannel()

int agora_gaming_rtc.IRtcEngine.JoinChannel ( string  channelName,
string  info,
uint  uid 
)

Allows a user to join a channel.

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:

  • The local client: OnJoinChannelSuccessHandler
  • The remote client: OnUserJoinedHandler, if the user joining the channel is in the Communication profile, or is a BROADCASTER in the Live Broadcast 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 OnReJoinChannelSuccessHandler callback on the local client.
Note
A channel does not accept duplicate uids, such as two users with the same 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.
Parameters
channelNameThe unique channel name for the Agora RTC session in the string format smaller than 64 bytes. Supported characters:
  • The 26 lowercase English letters: a to z
  • The 26 uppercase English letters: A to Z
  • The 10 numbers: 0 to 9
  • The space
  • "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ","
info(Optional) 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 OnJoinChannelSuccessHandler callback. Your application must record and maintain the returned uid since the SDK does not do so.
Returns
  • 0: Success.
  • < 0: Failure.
    • ERR_INVALID_ARGUMENT(-2)
    • ERR_NOT_READY(-3)
    • ERR_REFUSED(-5)

◆ JoinChannelByKey()

int agora_gaming_rtc.IRtcEngine.JoinChannelByKey ( string  channelKey,
string  channelName,
string  info,
uint  uid 
)

Allows a user to join a channel with token.

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 JoinChannelByKey method call triggers the following callbacks:

  • The local client: OnJoinChannelSuccessHandler
  • The remote client: OnUserJoinedHandler, if the user joining the channel is in the Communication profile, or is a BROADCASTER in the Live Broadcast 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 OnReJoinChannelSuccessHandler callback on the local client.
Note
A channel does not accept duplicate uids, such as two users with the same 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.
Warning
Ensure that the App ID used for creating the token is the same App ID used by the GetEngine method for initializing the IRtcEngine. Otherwise, the CDN live streaming may fail.
Parameters
channelKeyThe token generated by the application server. In most circumstances, a static App ID suffices. For added security, use a Channel Key.
  • If the user uses a static App ID, token is optional and can be set as NULL.
  • If the user uses a Channel Key, Agora issues an additional App Certificate for you to generate a user key based on the algorithm and App Certificate for user authentication on the server.
channelNameThe unique channel name for the Agora RTC session in the string format smaller than 64 bytes. Supported characters:
  • The 26 lowercase English letters: a to z
  • The 26 uppercase English letters: A to Z
  • The 10 numbers: 0 to 9
  • The space
  • "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ","
info(Optional) 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 OnJoinChannelSuccessHandler callback. Your application must record and maintain the returned uid since the SDK does not do so.
Returns
  • 0: Success.
  • < 0: Failure.
    • ERR_INVALID_ARGUMENT(-2)
    • ERR_NOT_READY(-3)
    • ERR_REFUSED(-5)

◆ RenewToken()

int agora_gaming_rtc.IRtcEngine.RenewToken ( string  token)

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.

Parameters
tokenThe new token.
Returns
  • 0: Success.
  • < 0: Failure.

◆ LeaveChannel()

int agora_gaming_rtc.IRtcEngine.LeaveChannel ( )

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 destroys 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 OnLeaveChannelHandler callback.

A successful LeaveChannel method call triggers the following callbacks:

  • The local client: OnLeaveChannelHandler
  • The remote client: OnUserOfflineHandler, if the user leaving the channel is in the Communication channel, or is a BROADCASTER in the Live Broadcast profile.
Note
  • If you call the Destroy method immediately after the LeaveChannel method, the LeaveChannel process interrupts, and the OnLeaveChannelHandler callback is not triggered.
  • If you call the LeaveChannel method during a CDN live streaming, the SDK triggers the RemovePublishStreamUrl method.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetParameters()

int agora_gaming_rtc.IRtcEngine.SetParameters ( string  parameters)

Provides the technical preview functionalities or special customizations by configuring the SDK with JSON options.

Parameters
parametersThe set parameters in a JSON string.
Returns
  • 0: Success.
  • < 0: Failure.

◆ GetCallId()

string agora_gaming_rtc.IRtcEngine.GetCallId ( )

Retrieves 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.

Returns
  • ≥ 0: The current call ID, if this method call succeeds.
  • < 0: Failure.

◆ Rate()

int agora_gaming_rtc.IRtcEngine.Rate ( string  callId,
int  rating,
string  desc 
)

Allows a user to rate a call after the call ends.

Parameters
callIdThe ID of the call, retrieved from the GetCallId method.
ratingRating 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.
desc(Optional) The description of the rating, with a string length of less than 800 bytes.
Returns
  • 0: Success.
  • < 0: Failure.

◆ Complain()

int agora_gaming_rtc.IRtcEngine.Complain ( string  callId,
string  desc 
)

Allows a user to complain about the call quality after a call ends.

Parameters
callIdThe ID of the call, retrieved from the GetCallId method.
desc(Optional) The description of the rating, with a string length of less than 800 bytes.
Returns
  • 0: Success.
  • < 0: Failure.

◆ EnableAudio()

int agora_gaming_rtc.IRtcEngine.EnableAudio ( )

Enables the audio module.

The audio mode is enabled by default.

Note
  • This method affects the internal engine and can be called after the LeaveChannel method. You can call this method either before or after joining a channel.
  • This method resets the internal engine and takes some time to take effect. We recommend using the following API methods to control the audio engine modules separately:
Returns
  • 0: Success.
  • < 0: Failure.

◆ DisableAudio()

int agora_gaming_rtc.IRtcEngine.DisableAudio ( )

Disables the audio module.

Note
  • This method affects the internal engine and can be called after the LeaveChannel method. You can call this method either before or after joining a channel.
  • This method resets the internal engine and takes some time to take effect. We recommend using the following API methods to control the audio engine modules separately:
Returns
  • 0: Success.
  • < 0: Failure.

◆ MuteLocalAudioStream()

int agora_gaming_rtc.IRtcEngine.MuteLocalAudioStream ( bool  mute)

Stops/Resumes sending the local audio stream.

Note
  • When mute is set as true, this method does not disable the microphone, which does not affect any ongoing recording.
  • If you call SetChannelProfile after this method, the SDK resets whether or not to mute the local audio according to the channel profile and user role. Therefore, we recommend calling this method after the SetChannelProfile method.
Parameters
muteSets whether to send/stop sending the local audio stream:
  • true: Stops sending the local audio stream.
  • false: (Default) Sends the local audio stream.
Returns
  • 0: Success.
  • < 0: Failure.

◆ MuteAllRemoteAudioStreams()

int agora_gaming_rtc.IRtcEngine.MuteAllRemoteAudioStreams ( bool  mute)

Stops/Resumes receiving all remote users' audio streams.

Parameters
muteSets whether to receive/stop receiving all remote users' audio streams.
  • true: Stops receiving all remote users' audio streams.
  • false: (Default) Receives all remote users' audio streams.
Returns
  • 0: Success.
  • < 0: Failure.

◆ MuteRemoteAudioStream()

int agora_gaming_rtc.IRtcEngine.MuteRemoteAudioStream ( uint  uid,
bool  mute 
)

Stops/Resumes receiving a specified remote user's audio stream.

Note
  • If you called the MuteAllRemoteAudioStreams method and set mute as true to stop receiving all remote users' audio streams, call the MuteAllRemoteAudioStreams method and set mute as false before calling this method.
  • The MuteAllRemoteAudioStreams method sets all remote audio streams, while the MuteRemoteAudioStream method sets a specified remote audio stream.
Parameters
uidUser ID of the specified remote user sending the audio.
muteSets whether to receive/stop receiving a specified remote user's audio stream:
  • true: Stops receiving the specified remote user's audio stream.
  • false: (Default) Receives the specified remote user's audio stream.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetEnableSpeakerphone()

int agora_gaming_rtc.IRtcEngine.SetEnableSpeakerphone ( bool  speakerphone)

Enables/Disables the audio playback route to the speakerphone.

This method sets whether the audio is routed to the speakerphone or earpiece.

See the default audio route explanation in the SetDefaultAudioRouteToSpeakerphone method and check whether it is necessary to call this method.

Note
  • This method is for Android and iOS only.
  • Ensure that you have successfully called the JoinChannelByKey method before calling this method.
  • After calling this method, the SDK returns the OnAudioRouteChangedHandler callback to indicate the changes.
  • This method does not take effect if a headset is used.
Parameters
speakerphoneSets whether to route the audio to the speakerphone or earpiece:
  • true: Route the audio to the speakerphone.
  • false: Route the audio to the earpiece.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetDefaultAudioRouteToSpeakerphone()

int agora_gaming_rtc.IRtcEngine.SetDefaultAudioRouteToSpeakerphone ( bool  speakerphone)

Sets the default audio playback route.

This method sets whether the received audio is routed to the earpiece or speakerphone by default before joining a channel. If a user does not call this method, the audio is routed to the earpiece by default. If you need to change the default audio route after joining a channel, call the SetEnableSpeakerphone method.

The default setting for each mode:

  • Voice: Earpiece.
  • Video: Speakerphone. If a user who is in the Communication profile calls the DisableVideo method or if the user calls the MuteLocalVideoStream and MuteAllRemoteVideoStreams methods, the default audio route switches back to the earpiece automatically.
  • Live Broadcast: Speakerphone.
  • Gaming Voice: Speakerphone.
Note
  • This method is for Android and iOS only.
  • This method only works in audio mode.
  • Call this method before calling the JoinChannelByKey method.
  • Regardless of whether the audio is routed to the speakerphone or earpiece by default, once a headset is plugged in or Bluetooth device is connected, the default audio route changes. The default audio route switches to the earpiece once removing the headset or disconnecting the Bluetooth device.
Parameters
speakerphoneSets the default audio route:
  • true: Speakerphone.
  • false: (Default) Earpiece.
Returns
  • 0: Success.
  • < 0: Failure.

◆ IsSpeakerphoneEnabled()

bool agora_gaming_rtc.IRtcEngine.IsSpeakerphoneEnabled ( )

Checks whether the speakerphone is enabled.

Note
This method is for Android and iOS only.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SwitchCamera()

int agora_gaming_rtc.IRtcEngine.SwitchCamera ( )

Switches between front and rear cameras.

Note
This method is for Android and iOS only.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetVideoProfile()

int agora_gaming_rtc.IRtcEngine.SetVideoProfile ( VIDEO_PROFILE_TYPE  profile,
bool  swapWidthAndHeight 
)

Sets the video profile.

Deprecated:
This method is deprecated as of v2.3. Use the SetVideoEncoderConfiguration method instead.

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.

Note
  • If you do not need to set the video profile after joining the channel, call this method before the EnableVideo method to reduce the render time of the first video frame.
  • Always set the video profile before calling the JoinChannelByKey or StartPreview method.
  • Since the landscape or portrait mode of the output video can be decided directly by the video profile, We recommend setting swapWidthAndHeight to false (default).
Parameters
profileSets the video profile. See VIDEO_PROFILE_TYPE.
swapWidthAndHeightSets whether to swap the width and height of the video stream:
  • true: Swap the width and height.
  • false: (Default) Do not swap the width and height. The width and height of the output video are consistent with the set video profile.
Returns
  • 0: Success.
  • < 0: Failure.

◆ MuteLocalVideoStream()

int agora_gaming_rtc.IRtcEngine.MuteLocalVideoStream ( bool  mute)

Stops/Resumes sending the local video stream.

A successful MuteLocalVideoStream method call triggers the OnUserMuteVideoHandler callback on the remote client.

Note
  • When set to true, this method does not disable the camera which does not affect the retrieval of the local video streams. This method executes faster than the EnableLocalVideo method which controls the sending of the local video stream.
  • If you call SetChannelProfile after this method, the SDK resets whether or not to mute the local video according to the channel profile and user role. Therefore, we recommend calling this method after the SetChannelProfile method.
Parameters
muteSets whether to send/stop sending the local video stream:
  • true: Stop sending the local video stream.
  • false: (Default) Send the local video stream.
Returns
  • 0: Success.
  • < 0: Failure.

◆ MuteAllRemoteVideoStreams()

int agora_gaming_rtc.IRtcEngine.MuteAllRemoteVideoStreams ( bool  mute)

Stops/Resumes receiving all remote video streams.

Parameters
muteSets whether to receive/stop receiving all remote users' video streams:
  • true: Stop receiving all remote users' video streams.
  • false: (Default) Receive all remote users' video streams.
Returns
  • 0: Success.
  • < 0: Failure.

◆ MuteRemoteVideoStream()

int agora_gaming_rtc.IRtcEngine.MuteRemoteVideoStream ( uint  uid,
bool  mute 
)

Stops/Resumes receiving the video stream from a specified remote user.

Note
If you called the MuteAllRemoteVideoStreams method and set mute as true to stop receiving all remote video streams, call the MuteAllRemoteVideoStreams method and set mute as false before calling this method.
Parameters
uidUser ID of the specified remote user.
muteSets whether to stop/resume receiving the video stream from a specified remote user:
  • true: Stop receiving the specified remote user's video stream.
  • false: (Default) Receive the specified remote user's video stream.
Returns
  • 0: Success.
  • < 0: Failure.

◆ EnableDualStreamMode()

int agora_gaming_rtc.IRtcEngine.EnableDualStreamMode ( bool  enabled)

Sets the stream mode to the single-stream (default) or dual-stream mode. (Live broadcast only.)

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).

Parameters
enabledSets the stream mode:
  • true: Dual-stream mode.
  • false: (Default) Single-stream mode.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetEncryptionMode()

int agora_gaming_rtc.IRtcEngine.SetEncryptionMode ( string  encryptionMode)

Sets the built-in encryption mode.

The Agora RTC 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.

Note
Call the SetEncryptionSecret method to enable the built-in encryption function before calling this method.
Parameters
encryptionModeThe set encryption mode:
  • "aes-128-xts": (Default) 128-bit AES encryption, XTS mode.
  • "aes-128-ecb": 128-bit AES encryption, ECB mode.
  • "aes-256-xts": 256-bit AES encryption, XTS mode.
  • "": When encryptionMode is set as NULL, the encryption mode is set as "aes-128-xts" by default.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetEncryptionSecret()

int agora_gaming_rtc.IRtcEngine.SetEncryptionSecret ( string  secret)

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.

Note
  • Do not use this method for CDN live streaming.
  • For optimal transmission, ensure that the encrypted data size does not exceed the original data size + 16 bytes. 16 bytes is the maximum padding size for AES encryption.
Parameters
secretThe encryption password.
Returns
  • 0: Success.
  • < 0: Failure.

◆ CreateDataStream()

int agora_gaming_rtc.IRtcEngine.CreateDataStream ( bool  reliable,
bool  ordered 
)

Creates a data stream.

Each user can create up to five data streams during the lifecycle of the IRtcEngine.

Note
Set both the reliable and ordered parameters to true or false. Do not set one as true and the other as false.
Parameters
reliableSets whether or not the recipients are guaranteed to receive the data stream from the sender within five seconds:
  • true: The recipients receive the data stream from the sender within five seconds. If the recipient does not receive the data stream within five seconds, an error is reported to the application.
  • false: There is no guarantee that the recipients receive the data stream within five seconds and no error message is reported for any delay or missing data stream.
orderedSets whether or not the recipients receive the data stream in the sent order:
  • true: The recipients receive the data stream in the sent order.
  • false: The recipients do not receive the data stream in the sent order.
Returns
  • ≥ 0: The ID of the data stream, if this method call succeeds.
  • < 0: Failure.

◆ SendStreamMessage()

int agora_gaming_rtc.IRtcEngine.SendStreamMessage ( int  streamId,
string  data 
)

Sends data stream messages to all users in a channel.

The SDK has the following restrictions on this method:

  • Up to 30 packets can be sent per second in a channel with each packet having a maximum size of 1 kB.
  • Each client can send up to 6 kB of data per second.
  • Each user can have up to five data streams simultaneously.

A successful SendStreamMessage method call triggers the OnStreamMessageHandler callback on the remote client, from which the remote user gets the stream message.

A failed SendStreamMessage method call triggers the OnStreamMessageHandler callback on the remote client.

Note
  • This method applies only to the Communication profile or to the hosts in the Live-broadcast profile. If an audience in the Live-broadcast profile calls this method, the audience may be switched to a host.
  • Ensure that you have created the data stream using CreateDataStream before calling this method.
Parameters
streamIdID of the sent data stream, returned in the CreateDataStream method.
dataThe sent data.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetSpeakerphoneVolume()

int agora_gaming_rtc.IRtcEngine.SetSpeakerphoneVolume ( int  volume)

Set the volume of the speaker. (macOS only.)

Deprecated:
This method is deprecated as of v2.3.0. Use AdjustRecordingSignalVolume and AdjustPlaybackSignalVolume instead.
Parameters
volumeSets the speakerphone volume. The value ranges between 0 (lowest volume) and 255 (highest volume).
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetVideoQualityParameters()

int agora_gaming_rtc.IRtcEngine.SetVideoQualityParameters ( bool  preferFrameRateOverImageQuality)

Sets the preferences for the high-quality video. (Live broadcast only).

Deprecated:
This method is deprecated as of v2.4.0.
Parameters
preferFrameRateOverImageQualitySets the video quality preference:
  • true: Frame rate over image quality.
  • false: (Default) Image quality over frame rate.
Returns
  • 0: Success.
  • < 0: Failure.

◆ StartEchoTest() [1/2]

int agora_gaming_rtc.IRtcEngine.StartEchoTest ( )

Starts an audio call test.

Deprecated:
This method is deprecated as of v2.4.0.

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:

  • The user speaks and the recording is played back within 10 seconds.
  • If the user can hear the recording within 10 seconds, the audio devices and network connection are working properly.
Note
  • After calling this method, always call the StopEchoTest method to end the test. Otherwise, the application cannot run the next echo test.
  • In the Live-broadcast profile, only the hosts can call this method. If the user switches from the Communication to Live-broadcast profile, the user must call the SetClientRole method to change the user role from the audience (default) to the host before calling this method.
Returns
  • 0: Success.
  • < 0: Failure.

◆ StartEchoTest() [2/2]

int agora_gaming_rtc.IRtcEngine.StartEchoTest ( int  intervalInSeconds)

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.

Note
  • Call this method before joining a channel.
  • After calling this method, call the StopEchoTest method to end the test. Otherwise, the app cannot run the next echo test, or call the JoinChannelByKey method.
  • In the Live-broadcast profile, only a host can call this method.
Parameters
intervalInSecondsThe time interval (sec) between when you speak and when the recording plays back.
Returns
  • 0: Success.
  • < 0: Failure.

◆ StopEchoTest()

int agora_gaming_rtc.IRtcEngine.StopEchoTest ( )

Stops the audio call test.

Returns
  • 0: Success.
  • < 0: Failure.

◆ StartLastmileProbeTest()

int agora_gaming_rtc.IRtcEngine.StartLastmileProbeTest ( LastmileProbeConfig  lastmileProbeConfig)

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:

  • OnLastmileQualityHandler: the SDK triggers this callback within two seconds depending on the network conditions. This callback rates the network conditions and is more closely linked to the user experience.
  • OnLastmileProbeResultHandler: the SDK triggers this callback within 30 seconds depending on the network conditions. This callback returns the real-time statistics of the network conditions and is more objective.
Note
  • This method consumes extra network traffic and may affect communication quality. We do not recommend calling this method together with EnableLastmileTest.
  • Do not call other methods before receiving the OnLastmileQualityHandler and OnLastmileProbeResultHandler callbacks. Otherwise, the callbacks may be interrupted.
  • In the Live-broadcast profile, a host should not call this method after joining a channel.
Parameters
lastmileProbeConfigSets the configurations of the last-mile network probe test. See LastmileProbeConfig.
Returns
  • 0: Success.
  • < 0: Failure.

◆ StopLastmileProbeTest()

int agora_gaming_rtc.IRtcEngine.StopLastmileProbeTest ( )

Stops the last-mile network probe test.

Returns
  • 0: Success.
  • < 0: Failure.

◆ AddVideoWatermark() [1/2]

int agora_gaming_rtc.IRtcEngine.AddVideoWatermark ( RtcImage  rtcImage)

Adds a watermark image to the local video or CDN live stream.

Deprecated:
This method is deprecated from v2.9.1. Use AddVideoWatermark instead.

This method adds a PNG watermark image to the local video stream for the recording 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.

Note
  • The URL descriptions are different for the local video and CDN live streams:
    • In a local video stream, url in RtcImage refers to the absolute path of the added watermark image file in the local video stream.
    • In a CDN live stream, url in RtcImage refers to the URL address of the added watermark image in the CDN live broadcast.
  • The source file of the watermark image must be in the PNG file format. If the width and height of the PNG file differ from your settings in this method, the PNG file will be cropped to conform to your settings.
  • The Agora RTC SDK supports adding only one watermark image onto a local video or CDN live stream. The newly added watermark image replaces the previous one.
Parameters
rtcImageThe watermark image to be added to the local video stream. See RtcImage.
Returns
  • 0: Success.
  • < 0: Failure.

◆ AddVideoWatermark() [2/2]

int agora_gaming_rtc.IRtcEngine.AddVideoWatermark ( string  watermarkUrl,
WatermarkOptions  watermarkOptions 
)

Adds a watermark image to the local video.

This method adds a PNG watermark image to the local video in a live broadcast. Once the watermark image is added, all the audience in the channel (CDN audience included), and the recording 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:

Note
  • Ensure that you have called the EnableVideo method to enable the video module before calling this method.
  • If you only want to add a watermark image to the local video for the audience in the CDN live broadcast channel to see and capture, you can call this method or the SetLiveTranscoding method.
  • This method supports adding a watermark image in the PNG file format only. Supported pixel formats of the PNG image are RGBA, RGB, Palette, Gray, and Alpha_gray.
  • If the dimensions of the PNG image differ from your settings in this method, the image will be cropped or zoomed to conform to your settings.
  • If you have enabled the local video preview by calling the StartPreview method, you can use the visibleInPreview member in the WatermarkOptions class to set whether or not the watermark is visible in preview.
Parameters
watermarkUrlThe 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.
watermarkOptionsThe watermark's options to be added. See WatermarkOptions for more infomation.
Returns
  • 0: Success.
  • < 0: Failure.

◆ ClearVideoWatermarks()

int agora_gaming_rtc.IRtcEngine.ClearVideoWatermarks ( )

Removes the watermark image from the video stream added by the AddVideoWatermark method.

Returns
  • 0: Success.
  • < 0: Failure.

◆ SetRemoteVideoStreamType()

int agora_gaming_rtc.IRtcEngine.SetRemoteVideoStreamType ( uint  uid,
REMOTE_VIDEO_STREAM_TYPE  streamType 
)

Sets the remote user's video stream type received by the local user when the remote user sends dual streams.

This method allows the application to adjust the corresponding video-stream type based on the size of the video window to reduce the bandwidth and resources.

  • If the remote user enables the dual-stream mode by calling the EnableDualStreamMode method, the SDK receives the high-stream video by default.
  • If the dual-stream mode is not enabled, the SDK receives the high-stream video by default.

The method result returns in the OnApiExecutedHandler callback. The SDK receives the high-stream video by default to reduce the bandwidth. If needed, users may use this method to switch to the low-stream video. By default, the aspect ratio of the low-stream video is the same as the high-stream video. Once the resolution of the high-stream video is set, the system automatically sets the resolution, frame rate, and bitrate of the low-stream video.

Parameters
uidID of the remote user sending the video stream.
streamTypeSets the video-stream type. See REMOTE_VIDEO_STREAM_TYPE.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetMixedAudioFrameParameters()

int agora_gaming_rtc.IRtcEngine.SetMixedAudioFrameParameters ( int  sampleRate,
int  samplesPerCall 
)

Sets the mixed audio format for the OnMixedAudioFrameHandler callback.

Note
The SDK calculates the sample interval according to the value of the channels of AudioFrame, sampleRate, and samplesPerCall parameters you set in this method. Sample interval (sec) = samplePerCall/(sampleRate × channels). Ensure that the value of sample interval is no less than 0.01. The SDK triggers the OnMixedAudioFrameHandler callback according to the sample interval.
Parameters
sampleRateSets the sample rate (samplesPerSec) returned in the OnMixedAudioFrameHandler callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.
samplesPerCallSets the number of samples the OnMixedAudioFrameHandler callback returns. Set it as 1024 for RTMP streaming.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetAudioMixingPosition()

int agora_gaming_rtc.IRtcEngine.SetAudioMixingPosition ( int  pos)

Sets the playback position of the music file to a different starting position (the default plays from the beginning).

Parameters
posThe playback starting position (ms) of the music file.
Returns
  • 0: Success.
  • < 0: Failure.

◆ EnableAudioVolumeIndication()

int agora_gaming_rtc.IRtcEngine.EnableAudioVolumeIndication ( int  interval,
int  smooth,
bool  report_vad 
)

Enables the OnVolumeIndicationHandler callback at a set time interval to report on which users are speaking and the speakers' volume.

Once this method is enabled, the SDK returns the volume indication in the OnVolumeIndicationHandler callback at the set time interval, whether or not any user is speaking in the channel.

Parameters
intervalSets the time interval between two consecutive volume indications:
  • ≤ 0: Disables the volume indication.
  • > 0: Time interval (ms) between two consecutive volume indications. We recommend setting interval > 200 ms. Do not set interval < 10 ms, or the OnVolumeIndicationHandler callback will not be triggered.
smoothSmoothing 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
  • true: Enable the voice activity detection of the local user. Once it is enabled, the vad parameter of the OnVolumeIndicationHandler callback reports the voice activity status of the local user.
  • false: (Default) Disable the voice activity detection of the local user. Once it is disabled, the vad parameter of the OnVolumeIndicationHandler callback does not report the voice activity status of the local user, except for the scenario where the engine automatically detects the voice activity of the local user.
Returns
  • 0: Success.
  • < 0: Failure.

◆ AdjustRecordingSignalVolume()

int agora_gaming_rtc.IRtcEngine.AdjustRecordingSignalVolume ( int  volume)

Adjusts the recording volume.

Parameters
volumeRecording volume. The value ranges between 0 and 400:
  • 0: Mute.
  • 100: Original volume.
  • 400: (Maximum) Four times the original volume with signal clipping protection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ AdjustPlaybackSignalVolume()

int agora_gaming_rtc.IRtcEngine.AdjustPlaybackSignalVolume ( int  volume)

Adjusts the playback volume of all remote users.

Note
  • This method adjusts the playback volume which is mixed volume of all remote users.
  • Since v2.3.2, to mute the local audio playback, call both AdjustPlaybackSignalVolume and AdjustAudioMixingVolume, and set volume as 0.
Parameters
volumeThe playback volume of all remote users. The value ranges from 0 to 400:
  • 0: Mute.
  • 100: Original volume.
  • 400: (Maximum) Four times the original volume with signal clipping protection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ StartAudioMixing()

int agora_gaming_rtc.IRtcEngine.StartAudioMixing ( string  filePath,
bool  loopback,
bool  replace,
int  cycle 
)

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 OnAudioMixingFinishedHandler callback.

A successful StartAudioMixing method call triggers the OnAudioMixingStateChangedHandler(PLAYING) callback on the local client.

When the audio mixing file playback finishes, the SDK triggers the OnAudioMixingStateChangedHandler(STOPPED) callback on the local client.

Note
  • Call this method when you are in a channel.
  • If the local audio mixing file does not exist, or if the SDK does not support the file format or cannot access the music file URL, the SDK returns WARN_AUDIO_MIXING_OPEN_ERROR(701).
Parameters
filePathThe absolute path (including the suffixes of the filename) of the local or online audio file to mix. Supported audio formats: 3GP, ASF, ADTS, AVI, MP3, MP4, MPEG-4, SAMI, and WAVE. For more information, see Supported Media Formats in Media Foundation.
loopbackSets which user can hear the audio mixing:
  • true: Only the local user can hear the audio mixing.
  • false: Both users can hear the audio mixing.
replaceSets the audio mixing content:
  • true: Only the specified audio file is published; the audio stream received by the microphone is not published.
  • false: The local audio file is mixed with the audio stream from the microphone.
cycleSets the number of playback loops:
  • Positive integer: Number of playback loops.
  • -1: Infinite playback loops.
Returns
  • 0: Success.
  • < 0: Failure.

◆ StopAudioMixing()

int agora_gaming_rtc.IRtcEngine.StopAudioMixing ( )

Stops playing and mixing the music file.

Call this method when you are in a channel.

Returns
  • 0: Success.
  • < 0: Failure.

◆ PauseAudioMixing()

int agora_gaming_rtc.IRtcEngine.PauseAudioMixing ( )

Pauses playing and mixing the music file.

Call this method when you are in a channel.

Returns
  • 0: Success.
  • < 0: Failure.

◆ ResumeAudioMixing()

int agora_gaming_rtc.IRtcEngine.ResumeAudioMixing ( )

Resumes playing and mixing the music file.

Call this method when you are in a channel.

Returns
  • 0: Success.
  • < 0: Failure.

◆ AdjustAudioMixingVolume()

int agora_gaming_rtc.IRtcEngine.AdjustAudioMixingVolume ( int  volume)

Adjusts the volume during audio mixing.

Call this method when you are in a channel.

Note
Calling this method does not affect the volume of audio effect file playback invoked by the PlayEffect method.
Parameters
volumeAudio mixing volume. The value ranges between 0 and 100.
  • 0: Mute.
  • 100: Original volume.
Returns
  • 0: Success.
  • < 0: Failure.

◆ GetAudioMixingDuration()

int agora_gaming_rtc.IRtcEngine.GetAudioMixingDuration ( )

Retrieves the duration (ms) of the music file.

Call this method when you are in a channel.

Returns
  • ≥ 0: The audio mixing duration, if this method call succeeds.
  • < 0: Failure.

◆ GetAudioMixingCurrentPosition()

int agora_gaming_rtc.IRtcEngine.GetAudioMixingCurrentPosition ( )

Retrieves the playback position (ms) of the music file.

Call this method when you are in a channel.

Returns
  • ≥ 0: The current playback position of the audio mixing, if this method call succeeds.
  • < 0: Failure.

◆ StartAudioRecording() [1/2]

int agora_gaming_rtc.IRtcEngine.StartAudioRecording ( string  filePath,
AUDIO_RECORDING_QUALITY_TYPE  quality 
)

Starts an audio recording.

Deprecated:
Use StartAudioRecording2 instead.

The SDK allows recording during a call. Supported formats:

  • .wav: Large file size with high fidelity.
  • .aac: Small file size with low fidelity.

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 JoinChannelByKey method.
  • The recording automatically stops when the LeaveChannel method is called.
Parameters
filePathPointer to the absolute file path of the recording file. The string of the file name is in UTF-8.
qualitySets the audio recording quality. See AUDIO_RECORDING_QUALITY_TYPE.
Returns
  • 0: Success.
  • < 0: Failure.

◆ StartAudioRecording() [2/2]

int agora_gaming_rtc.IRtcEngine.StartAudioRecording ( string  filePath,
int  sampleRate,
AUDIO_RECORDING_QUALITY_TYPE  quality 
)

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:

  • .wav: Large file size with high fidelity.
  • .aac: Small file size with low fidelity.
Note
Parameters
filePathPointer to the absolute file path of the recording file. The string of the file name is in UTF-8.
sampleRateSample rate (Hz) of the recording file. Supported values are as follows:
  • 16000
  • (Default) 32000
  • 44100
  • 48000
qualitySets the audio recording quality. See AUDIO_RECORDING_QUALITY_TYPE.
Returns
  • 0: Success.
  • < 0: Failure.

◆ StopAudioRecording()

int agora_gaming_rtc.IRtcEngine.StopAudioRecording ( )

Stops an audio recording on the client.

You can call this method before calling the LeaveChannel method else, the recording automatically stops when the LeaveChannel method is called.

Returns
  • 0: Success.
  • < 0: Failure.

◆ GetAudioEffectManager()

IAudioEffectManager agora_gaming_rtc.IRtcEngine.GetAudioEffectManager ( )

Retrieves the AudioEffectManagerImpl object.

Returns
The AudioEffectManagerImpl object.

◆ GetAudioRecordingDeviceManager()

IAudioRecordingDeviceManager agora_gaming_rtc.IRtcEngine.GetAudioRecordingDeviceManager ( )

Retrieves the AudioRecordingDeviceManager object.

Returns
The AudioRecordingDeviceManager object.

◆ GetAudioPlaybackDeviceManager()

IAudioPlaybackDeviceManager agora_gaming_rtc.IRtcEngine.GetAudioPlaybackDeviceManager ( )

Retrieves the AudioPlaybackDeviceManager object.

Returns
The AudioPlaybackDeviceManager object.

◆ GetVideoDeviceManager()

IVideoDeviceManager agora_gaming_rtc.IRtcEngine.GetVideoDeviceManager ( )

Retrieves the VideoDeviceManager object.

Returns
The VideoDeviceManager object.

◆ GetAudioRawDataManager()

IAudioRawDataManager agora_gaming_rtc.IRtcEngine.GetAudioRawDataManager ( )

Retrieves the AudioRawDataManager object.

Returns
The AudioRawDataManager object.

◆ GetVideoRawDataManager()

IVideoRawDataManager agora_gaming_rtc.IRtcEngine.GetVideoRawDataManager ( )

Retrieves the VideoRawDataManager object.

Returns
The VideoRawDataManager object.

◆ EnableVideo()

int agora_gaming_rtc.IRtcEngine.EnableVideo ( )

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 OnUserEnableVideoHandler(true) callback on the remote client.

Note
  • To get video raw data, call both EnableVideo and EnableVideoObserver methods.
  • This method affects the internal engine and can be called after the LeaveChannel method.
  • This method resets the internal engine and takes some time to take effect. We recommend using the following API methods to control the video engine modules separately:
Returns
  • 0: Success.
  • < 0: Failure.

◆ DisableVideo()

int agora_gaming_rtc.IRtcEngine.DisableVideo ( )

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 OnUserEnableVideoHandler(false) callback on the remote client.

Note
  • To stop getting video raw data, call both DisableVideo and DisableVideoObserver methods.
  • This method affects the internal engine and can be called after the LeaveChannel method.
  • This method resets the internal engine and takes some time to take effect. We recommend using the following API methods to control the video engine modules separately:
Returns
  • 0: Success.
  • < 0: Failure.

◆ EnableLocalVideo()

int agora_gaming_rtc.IRtcEngine.EnableLocalVideo ( bool  enabled)

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 OnUserEnableLocalVideoHandler callback on the remote client.

Note
This method affects the internal engine and can be called after the LeaveChannel method.
Parameters
enabledSets whether to disable/re-enable the local video, including the capturer, renderer, and sender:
  • true: (Default) Re-enable the local video.
  • false: Disable the local video. Once the local video is disabled, the remote users can no longer receive the video stream of this user, while this user can still receive the video streams of the other remote users.
Returns
  • 0: Success.
  • < 0: Failure.

◆ EnableLocalAudio()

int agora_gaming_rtc.IRtcEngine.EnableLocalAudio ( bool  enabled)

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 or playing 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.

The SDK triggers the OnMicrophoneEnabledHandler callback once the local audio function is disabled or enabled.

Note
  • Call this method after the JoinChannelByKey method.
  • This method is different from the MuteLocalAudioStream method:
    • EnableLocalAudio: Disables/Re-enables the local audio capturing and processing. If you disable or re-enable local audio recording using the EnableLocalAudio method, the local user may hear a pause in the remote audio playback.
    • MuteLocalAudioStream: Sends/Stops sending the local audio streams.
Parameters
enabledSets whether to disable/re-enable the local audio function:
  • true: (Default) Re-enable the local audio function, that is, to start the local audio capturing device (for example, the microphone).
  • false: Disable the local audio function, that is, to stop local audio capturing.
Returns
  • 0: Success.
  • < 0: Failure.

◆ StartPreview()

int agora_gaming_rtc.IRtcEngine.StartPreview ( )

Starts the local video preview before joining the channel.

Before calling this method, you must call the EnableVideo method to enable video.

Note
Once the StartPreview method is called to start the local video preview, if you leave the channel by calling the LeaveChannel method, the local video preview remains until you call the StopPreview method to disable it.
Returns
  • 0: Success.
  • < 0: Failure.

◆ StopPreview()

int agora_gaming_rtc.IRtcEngine.StopPreview ( )

Stops the local video preview and disables video.

Returns
  • 0: Success.
  • < 0: Failure.

◆ EnableVideoObserver()

int agora_gaming_rtc.IRtcEngine.EnableVideoObserver ( )

Enables the video observer.

This method sends the video pictures directly to the app instead of to the traditional view renderer.

Note
  • To get video raw data, call both EnableVideo and EnableVideoObserver methods.
  • Call this method before joining a channel.
Returns
  • 0: Success.
  • < 0: Failure.

◆ DisableVideoObserver()

int agora_gaming_rtc.IRtcEngine.DisableVideoObserver ( )

Disables the video observer.

This method disables sending video directly to the app.

Note
  • To stop getting video raw data, call both DisableVideo and DisableVideoObserver methods.
  • Call this method after leaving the channel.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetDefaultMuteAllRemoteAudioStreams()

int agora_gaming_rtc.IRtcEngine.SetDefaultMuteAllRemoteAudioStreams ( bool  mute)

Sets whether to receive all remote audio streams by default. You can call this method either before or after joining a channel. If you call SetDefaultMuteAllRemoteAudioStreams (true) after joining a channel, the remote audio streams of all subsequent users are not received.

Note
If you want to resume receiving the audio stream, call MuteRemoteAudioStream (false), and specify the ID of the remote user whose audio stream you want to receive. To receive the audio streams of multiple remote users, call MuteRemoteAudioStream (false) as many times. Calling SetDefaultMuteAllRemoteAudioStreams (false) resumes receiving the audio streams of subsequent users only.
Parameters
muteSets whether to receive/stop receiving all remote users' audio streams by default:
  • true: Stops receiving all remote users' audio streams by default.
  • false: (Default) Receives all remote users' audio streams by default.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetDefaultMuteAllRemoteVideoStreams()

int agora_gaming_rtc.IRtcEngine.SetDefaultMuteAllRemoteVideoStreams ( bool  mute)

Sets whether to receive all remote video streams by default. You can call this method either before or after joining a channel. If you call SetDefaultMuteAllRemoteVideoStreams (true) after joining a channel, the remote video streams of all subsequent users are not received.

Note
If you want to resume receiving the video stream, call MuteRemoteVideoStream (false), and specify the ID of the remote user whose video stream you want to receive. To receive the video streams of multiple remote users, call MuteRemoteVideoStream (false) as many times. Calling SetDefaultMuteAllRemoteVideoStreams (false) resumes receiving the video streams of subsequent users only.
Parameters
muteSets whether to receive/stop receiving all remote users' video streams by default:
  • true: Stop receiving all remote users' video streams by default.
  • false: (Default) Receive all remote users' video streams by default.
Returns
  • 0: Success.
  • < 0: Failure.

◆ EnableLastmileTest()

int agora_gaming_rtc.IRtcEngine.EnableLastmileTest ( )

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 OnLastmileQualityHandler callback, and before joining a channel.

Note
  • Do not call any other methods before receiving the OnLastmileQualityHandler callback. Otherwise, the callback may be interrupted by other methods, and hence may not be triggered.
  • A host should not call this method after joining a channel (when in a call).
  • If you call this method to test the last-mile quality, the SDK consumes the bandwidth of a video stream, whose bitrate corresponds to the bitrate you set in the SetVideoEncoderConfiguration method. After you join the channel, whether you have called the DisableLastmileTest method or not, the SDK automatically stops consuming the bandwidth.
Returns
  • 0: Success.
  • < 0: Failure.

◆ DisableLastmileTest()

int agora_gaming_rtc.IRtcEngine.DisableLastmileTest ( )

Disables the network connection quality test.

Returns
  • 0: Success.
  • < 0: Failure.

◆ GetConnectionState()

CONNECTION_STATE_TYPE agora_gaming_rtc.IRtcEngine.GetConnectionState ( )

Retrieves the connection state of the SDK.

Returns
CONNECTION_STATE_TYPE

◆ SetAudioProfile()

int agora_gaming_rtc.IRtcEngine.SetAudioProfile ( AUDIO_PROFILE_TYPE  audioProfile,
AUDIO_SCENARIO_TYPE  scenario 
)

Sets the audio parameters and application scenarios.

Note
Parameters
audioProfileSets the sample rate, bitrate, encoding mode, and the number of channels. See AUDIO_PROFILE_TYPE.
scenarioSets the audio application scenario. See AUDIO_SCENARIO_TYPE. Under different audio scenarios, the device uses different volume tracks, i.e. either the in-call volume or the media volume. For details, see What is the difference between the in-call volume and the media volume?.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetVideoEncoderConfiguration()

int agora_gaming_rtc.IRtcEngine.SetVideoEncoderConfiguration ( VideoEncoderConfiguration  configuration)

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.

Note
If you do not need to set the video encoder configuration after joining the channel, you can call this method before the EnableVideo method to reduce the render time of the first video frame.
Parameters
configurationSets the local video encoder configuration. See VideoEncoderConfiguration.
Returns
  • 0: Success.
  • < 0: Failure.

◆ AdjustAudioMixingPlayoutVolume()

int agora_gaming_rtc.IRtcEngine.AdjustAudioMixingPlayoutVolume ( int  volume)

Adjusts the audio mixing volume for local playback.

Note
Call this method when you are in a channel.
Parameters
volumeAudio mixing volume for local playback. The value ranges between 0 and 100 (default).
Returns
  • 0: Success.
  • < 0: Failure.

◆ AdjustAudioMixingPublishVolume()

int agora_gaming_rtc.IRtcEngine.AdjustAudioMixingPublishVolume ( int  volume)

Adjusts the audio mixing volume for publishing (for remote users).

Note
Call this method when you are in a channel.
Parameters
volumeAudio mixing volume for publishing. The value ranges between 0 and 100 (default).
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetVolumeOfEffect()

int agora_gaming_rtc.IRtcEngine.SetVolumeOfEffect ( int  soundId,
int  volume 
)

Sets the volume of a specified audio effect.

Parameters
soundIdID of the audio effect. Each audio effect has a unique ID.
volumeSets the volume of the specified audio effect. The value ranges between 0 and 100 (default).
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetRecordingAudioFrameParameters()

int agora_gaming_rtc.IRtcEngine.SetRecordingAudioFrameParameters ( int  sampleRate,
int  channel,
RAW_AUDIO_FRAME_OP_MODE_TYPE  mode,
int  samplesPerCall 
)

Sets the audio recording format for the OnRecordAudioFrameHandler callback.

Note
The SDK calculates the sample interval according to the value of the sampleRate, channel, and samplesPerCall parameters you set in this method. Sample interval (sec) = samplePerCall/(sampleRate × channel). Ensure that the value of sample interval is no less than 0.01. The SDK triggers the OnRecordAudioFrameHandler callback according to the sample interval.
Parameters
sampleRateSets the sample rate returned in the OnRecordAudioFrameHandler callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.
channelSets the number of audio channels returned in the OnRecordAudioFrameHandler callback:
  • 1: Mono
  • 2: Stereo
modeSets the use mode (see RAW_AUDIO_FRAME_OP_MODE_TYPE) of the OnRecordAudioFrameHandler callback.
samplesPerCallSets the number of samples the OnRecordAudioFrameHandler callback returns. Set it as 1024 for RTMP streaming.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetPlaybackAudioFrameParameters()

int agora_gaming_rtc.IRtcEngine.SetPlaybackAudioFrameParameters ( int  sampleRate,
int  channel,
RAW_AUDIO_FRAME_OP_MODE_TYPE  mode,
int  samplesPerCall 
)

Sets the audio playback format for the OnPlaybackAudioFrameHandler callback.

Note
The SDK calculates the sample interval according to the value of the sampleRate, channel, and samplesPerCall parameters you set in this method. Sample interval (sec) = samplePerCall/(sampleRate × channel). Ensure that the value of sample interval is no less than 0.01. The SDK triggers the OnPlaybackAudioFrameHandler callback according to the sample interval.
Parameters
sampleRateSets the sample rate returned in the OnPlaybackAudioFrameHandler callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.
channelSets the number of channels returned in the OnPlaybackAudioFrameHandler callback:
  • 1: Mono
  • 2: Stereo
modeSets the use mode (see RAW_AUDIO_FRAME_OP_MODE_TYPE) of the OnPlaybackAudioFrameHandler callback.
samplesPerCallSets the number of samples the OnPlaybackAudioFrameHandler callback returns. Set it as 1024 for RTMP streaming.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetLocalPublishFallbackOption()

int agora_gaming_rtc.IRtcEngine.SetLocalPublishFallbackOption ( STREAM_FALLBACK_OPTIONS  option)

Sets the fallback option for the locally published video stream based on the network conditions.

If option is set as STREAM_FALLBACK_OPTION_AUDIO_ONLY(2), the SDK will:

  • Disable the upstream video but enable audio only when the network conditions deteriorate and cannot support both video and audio.
  • Re-enable the video when the network conditions improve.

When the locally published video stream falls back to audio only or when the audio-only stream switches back to the video, the SDK triggers the OnLocalPublishFallbackToAudioOnlyHandler callback.

Note
Agora does not recommend using this method for CDN live streaming, because the remote CDN live user will have a noticeable lag when the locally published video stream falls back to audio only.
Parameters
optionSets the fallback option for the locally published video stream. See STREAM_FALLBACK_OPTIONS.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetRemoteSubscribeFallbackOption()

int agora_gaming_rtc.IRtcEngine.SetRemoteSubscribeFallbackOption ( STREAM_FALLBACK_OPTIONS  option)

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 OnRemoteSubscribeFallbackToAudioOnlyHandler callback.

Parameters
optionSets the fallback option for the remotely subscribed video stream. See STREAM_FALLBACK_OPTIONS.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetRemoteDefaultVideoStreamType()

int agora_gaming_rtc.IRtcEngine.SetRemoteDefaultVideoStreamType ( REMOTE_VIDEO_STREAM_TYPE  remoteVideoStreamType)

Sets the default video-stream type for the video received by the local user when the remote user sends dual streams.

  • If the dual-stream mode is enabled by calling the EnableDualStreamMode method, the user receives the high-stream video by default. The SetRemoteDefaultVideoStreamType method allows the application to adjust the corresponding video-stream type according to the size of the video window, reducing the bandwidth and resources.
  • If the dual-stream mode is not enabled, the user receives the high-stream video by default.

The result after calling this method is returned in the OnApiExecutedHandler callback. The Agora RTC SDK receives the high-stream video by default to reduce the bandwidth. If needed, users can switch to the low-stream video through this method.

Parameters
remoteVideoStreamTypeSets the default video-stream type. See REMOTE_VIDEO_STREAM_TYPE.
Returns
  • 0: Success.
  • < 0: Failure.

◆ AddPublishStreamUrl()

int agora_gaming_rtc.IRtcEngine.AddPublishStreamUrl ( string  url,
bool  transcodingEnabled 
)

Publishes the local stream to a specified CDN live RTMP address. (CDN live only.)

The SDK returns the result of this method call in the OnStreamPublishedHandler callback.

The AddPublishStreamUrl method call triggers the OnRtmpStreamingStateChangedHandler callback on the local client to report the state of adding a local stream to the CDN.

Note
  • Ensure that the user joins the channel before calling this method.
  • Ensure that you enable the RTMP Converter service before using this function.
  • This method adds only one stream RTMP URL address each time it is called.
  • This method applies to Live Broadcast only.
Parameters
urlThe CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. The RTMP URL address must not contain special characters, such as Chinese language characters.
transcodingEnabledSets whether transcoding is enabled/disabled:
  • true: Enable transcoding. To transcode the audio or video streams when publishing them to CDN live, often used for combining the audio and video streams of multiple hosts in CDN live. If you set this parameter as true, ensure that you call the SetLiveTranscoding method before this method.
  • false: Disable transcoding.
Returns
  • 0: Success.
  • < 0: Failure.
    • ERR_INVALID_ARGUMENT(-2): The RTMP URL address is NULL or has a string length of 0.
    • ERR_NOT_INITIALIZED(-7): You have not initialized the RTC engine when publishing the stream.

◆ RemovePublishStreamUrl()

int agora_gaming_rtc.IRtcEngine.RemovePublishStreamUrl ( string  url)

Removes an RTMP stream from the CDN. (CDN live only.)

This method removes the RTMP URL address (added by the AddPublishStreamUrl method) from a CDN live stream. The SDK returns the result of this method call in the OnStreamUnpublishedHandler callback.

The RemovePublishStreamUrl method call triggers the OnRtmpStreamingStateChangedHandler callback on the local client to report the state of removing an RTMP stream from the CDN.

Note
  • This method removes only one RTMP URL address each time it is called.
  • The RTMP URL address must not contain special characters, such as Chinese language characters.
  • This method applies to Live Broadcast only.
Parameters
urlThe RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes.
Returns
  • 0: Success.
  • < 0: Failure.

◆ GetErrorDescription()

static string agora_gaming_rtc.IRtcEngine.GetErrorDescription ( int  code)
static

Retrieves the description of a warning or error code.

Parameters
codeThe warning or error code that the OnSDKWarningHandler or OnSDKErrorHandler callback returns.
Returns
Warning Code or Error Code.

◆ EnableWebSdkInteroperability()

int agora_gaming_rtc.IRtcEngine.EnableWebSdkInteroperability ( bool  enabled)

Enables interoperability with the Agora Web SDK.

Note
  • This method applies only to the Live-broadcast profile. In the Communication profile, interoperability with the Agora Web SDK is enabled by default.
  • If the channel has Web SDK users, ensure that you call this method, or the video of the Native user will be a black screen for the Web user.
Parameters
enabledSets whether to enable/disable interoperability with the Agora Web SDK:
  • true: Enable.
  • false: (Default) Disable.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetLiveTranscoding()

int agora_gaming_rtc.IRtcEngine.SetLiveTranscoding ( LiveTranscoding  transcoding)

Sets the video layout and audio settings for CDN live. (CDN live only.)

The SDK triggers the OnTranscodingUpdatedHandler callback when you call the SetLiveTranscoding method to update the transcoding setting.

Note
  • This method applies to Live Broadcast only.
  • Ensure that you enable the RTMP Converter service before using this function.
  • If you call the SetLiveTranscoding method to update the transcoding setting for the first time, the SDK does not trigger the OnTranscodingUpdatedHandler callback.
Parameters
transcodingSets the CDN live audio/video transcoding settings. See LiveTranscoding.
Returns
  • 0: Success.
  • < 0: Failure.

◆ PushVideoFrame()

int agora_gaming_rtc.IRtcEngine.PushVideoFrame ( ExternalVideoFrame  externalVideoFrame)

Pushes the video frame using the ExternalVideoFrame and passes the video frame to the Agora RTC SDK.

Note
This method does not support video frames in the Texture format.
Parameters
externalVideoFrameVideo frame to be pushed. See ExternalVideoFrame.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetExternalVideoSource()

int agora_gaming_rtc.IRtcEngine.SetExternalVideoSource ( bool  enable,
bool  useTexture 
)

Configures the external video source.

Parameters
enableSets whether to use the external video source:
  • true: Use the external video source.
  • false: (Default) Do not use the external video source.
useTextureSets whether to use texture as an input (Agora does not support texture now, please use false):
  • true: Use texture as an input.
  • false: (Default) Do not use texture as an input.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetExternalAudioSource()

int agora_gaming_rtc.IRtcEngine.SetExternalAudioSource ( bool  enabled,
int  sampleRate,
int  channels 
)

Sets the external audio source. Please call this method before JoinChannelByKey.

Parameters
enabledSets whether to enable/disable the external audio source:
  • true: Enables the external audio source.
  • false: (Default) Disables the external audio source.
sampleRateSets the sample rate (Hz) of the external audio source, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.
channelsSets the number of audio channels of the external audio source:
  • 1: Mono.
  • 2: Stereo.
Returns
  • 0: Success.
  • < 0: Failure.

◆ PushAudioFrame()

int agora_gaming_rtc.IRtcEngine.PushAudioFrame ( AudioFrame  audioFrame)

Pushes the external audio frame.

Parameters
audioFrameThe audio frame: AudioFrame.
Returns
  • 0: Success.
  • < 0: Failure.

◆ GetAudioMixingPlayoutVolume()

int agora_gaming_rtc.IRtcEngine.GetAudioMixingPlayoutVolume ( )

Retrieves the audio mixing volume for local playback.

This method helps troubleshoot audio volume related issues.

Note
Call this method when you are in a channel.
Returns
  • ≥ 0: The audio mixing volume, if this method call succeeds. The value range is [0,100].
  • < 0: Failure.

◆ GetAudioMixingPublishVolume()

int agora_gaming_rtc.IRtcEngine.GetAudioMixingPublishVolume ( )

Retrieves the audio mixing volume for publishing.

This method helps troubleshoot audio volume related issues.

Note
Call this method when you are in a channel.
Returns
  • ≥ 0: The audio mixing volume for publishing, if this method call succeeds. The value range is [0,100].
  • < 0: Failure.

◆ EnableSoundPositionIndication()

int agora_gaming_rtc.IRtcEngine.EnableSoundPositionIndication ( bool  enabled)

Enables/Disables stereo panning for remote users.

Ensure that you call this method before JoinChannelByKey to enable stereo panning for remote users so that the local user can track the position of a remote user by calling SetRemoteVoicePosition.

Parameters
enabledSets whether or not to enable stereo panning for remote users:
  • true: enables stereo panning.
  • false: disables stereo panning.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetLocalVoiceChanger()

int agora_gaming_rtc.IRtcEngine.SetLocalVoiceChanger ( VOICE_CHANGER_PRESET  voiceChanger)

Sets the local voice changer option.

Note
Do not use this method together with the SetLocalVoiceReverbPreset method, because the method called later overrides the one called earlier.
Parameters
voiceChangerSets the local voice changer option. See VOICE_CHANGER_PRESET.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetLocalVoiceReverbPreset()

int agora_gaming_rtc.IRtcEngine.SetLocalVoiceReverbPreset ( AUDIO_REVERB_PRESET  audioReverbPreset)

Sets the preset local voice reverberation effect.

Note
  • Do not use this method together with SetLocalVoiceReverb.
  • Do not use this method together with the SetLocalVoiceChanger method, because the method called later overrides the one called earlier.
Parameters
audioReverbPresetSets the preset audio reverberation configuration. See AUDIO_REVERB_PRESET.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetLocalVoicePitch()

int agora_gaming_rtc.IRtcEngine.SetLocalVoicePitch ( double  pitch)

Changes the voice pitch of the local speaker.

Parameters
pitchSets 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).
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetLocalVoiceEqualization()

int agora_gaming_rtc.IRtcEngine.SetLocalVoiceEqualization ( AUDIO_EQUALIZATION_BAND_FREQUENCY  bandFrequency,
int  bandGain 
)

Sets the local voice equalization effect.

Parameters
bandFrequencySets 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, 500, 1k, 2k, 4k, 8k, and 16k Hz. See AUDIO_EQUALIZATION_BAND_FREQUENCY.
bandGainSets the gain of each band in dB. The value ranges between -15 and 15.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetLocalVoiceReverb()

int agora_gaming_rtc.IRtcEngine.SetLocalVoiceReverb ( AUDIO_REVERB_TYPE  reverbKey,
int  value 
)

Sets the local voice reverberation.

Note
v2.4.0 adds the SetLocalVoiceReverbPreset method, a more user-friendly method for setting the local voice reverberation. You can use this method to set the local reverberation effect, such as pop music, R&B, rock music, and hip-hop.
Parameters
reverbKeySets the reverberation key. See AUDIO_REVERB_TYPE.
valueSets the value of the reverberation key.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetCameraCapturerConfiguration()

int agora_gaming_rtc.IRtcEngine.SetCameraCapturerConfiguration ( CameraCapturerConfiguration  cameraCaptureConfiguration)

Sets the camera capture configuration.

For a video call or live broadcast, 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:

Note
Call this method before enabling the local camera. That said, you can call this method before calling JoinChannelByKey, EnableVideo, or EnableLocalVideo, depending on which method you use to turn on your local camera.
Parameters
cameraCaptureConfigurationSets the camera capturer configuration. See CameraCapturerConfiguration.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetRemoteUserPriority()

int agora_gaming_rtc.IRtcEngine.SetRemoteUserPriority ( uint  uid,
PRIORITY_TYPE  userPriority 
)

Prioritizes a remote user's stream.

Use this method with the SetRemoteSubscribeFallbackOption method. If the fallback function is enabled for a subscribed stream, the SDK ensures the high-priority user gets the best possible stream quality.

Note
The Agora RTC SDK supports setting userPriority as high for one user only.
Parameters
uidThe ID of the remote user.
userPrioritySets the priority of the remote user. See PRIORITY_TYPE.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetLogFileSize()

int agora_gaming_rtc.IRtcEngine.SetLogFileSize ( uint  fileSizeInKBytes)

Sets the log file size (KB).

The SDK has two log files, each with a default size of 512 KB. If you set fileSizeInKBytes as 1024 KB, the SDK outputs log files with a total maximum size of 2 MB. If the total size of the log files exceed the set value, the new output log files overwrite the old output log files.

Parameters
fileSizeInKBytesThe SDK log file size (KB).
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetExternalAudioSink()

int agora_gaming_rtc.IRtcEngine.SetExternalAudioSink ( bool  enabled,
int  sampleRate,
int  channels 
)

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.

Note
Once you enable the external audio sink, the app will not retrieve any audio data from the OnPlaybackAudioFrameHandler callback.
Parameters
enabled
  • true: Enables the external audio sink.
  • false: (Default) Disables the external audio sink.
sampleRateSets the sample rate (Hz) of the external audio sink, which can be set as 16000, 32000, 44100 or 48000.
channelsSets the number of audio channels of the external audio sink:
  • 1: Mono.
  • 2: Stereo.
Returns
  • 0: Success.
  • < 0: Failure.

◆ RegisterLocalUserAccount()

int agora_gaming_rtc.IRtcEngine.RegisterLocalUserAccount ( string  appId,
string  userAccount 
)

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 OnLocalUserRegisteredHandler 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:

  • Call the RegisterLocalUserAccount method to create a user account, and then the JoinChannelWithUserAccount method to join the channel.
  • Call the JoinChannelWithUserAccount method to join the channel.

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.

Note
  • Ensure that you set the userAccount parameter. Otherwise, this method does not take effect.
  • Ensure that the value of the userAccount parameter is unique in the channel.
  • To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the uid of the user is set to the same parameter type.
Parameters
appIdThe App ID of your project.
userAccountThe user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
Returns
  • 0: Success.
  • < 0: Failure.

◆ JoinChannelWithUserAccount()

int agora_gaming_rtc.IRtcEngine.JoinChannelWithUserAccount ( string  token,
string  channelId,
string  userAccount 
)

Joins the channel with a user account.

After the user successfully joins the channel, the SDK triggers the following callbacks:

Note
To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the uid of the user is set to the same parameter type.
Parameters
tokenThe token generated at your server:
  • For low-security requirements: You can use the temporary token generated at Console. For details, see Get a temporary toke.
  • For high-security requirements: Set it as the token generated at your server. For details, see Get a token.
channelIdThe channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
userAccountThe user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
Returns
  • 0: Success.
  • < 0: Failure.

◆ GetUserInfoByUserAccount()

UserInfo agora_gaming_rtc.IRtcEngine.GetUserInfoByUserAccount ( string  account)

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 OnUserInfoUpdatedHandler callback on the local client.

After receiving the OnUserInfoUpdatedHandler 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.

Parameters
accountThe user account of the user. Ensure that you set this parameter.
Returns
  • 0: Success.
  • < 0: Failure.

◆ GetUserInfoByUid()

UserInfo agora_gaming_rtc.IRtcEngine.GetUserInfoByUid ( uint  uid)

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 OnUserInfoUpdatedHandler callback on the local client.

After receiving the OnUserInfoUpdatedHandler 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.

Parameters
uidThe user ID of the remote user. Ensure that you set this parameter.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetBeautyEffectOptions()

int agora_gaming_rtc.IRtcEngine.SetBeautyEffectOptions ( bool  enabled,
BeautyOptions  beautyOptions 
)

Enables/Disables image enhancement and sets the options.

Note
This method is for Android and iOS only.
Parameters
enabledSets whether or not to enable image enhancement:
  • true: enables image enhancement.
  • false: disables image enhancement.
beautyOptionsSets the image enhancement option. See BeautyOptions.
Returns
  • 0: Success.
  • < 0: Failure.

◆ StartScreenCaptureByDisplayId()

int agora_gaming_rtc.IRtcEngine.StartScreenCaptureByDisplayId ( uint  displayId,
Rectangle  rectangle,
ScreenCaptureParameters  screenCaptureParameters 
)

Shares the whole or part of a screen by specifying the display ID.

Note
This method is for macOS only.
Parameters
displayIdThe display ID of the screen to be shared. This parameter specifies which screen you want to share.
rectangle(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.
screenCaptureParametersSets the screen sharing encoding parameters. See ScreenCaptureParameters.
Returns
  • 0: Success.
  • < 0: Failure.
    • ERR_INVALID_STATE: the screen sharing state is invalid, probably because another screen or window is being shared. Call StopScreenCapture to stop the current screen sharing.
    • ERR_INVALID_ARGUMENT(-2): the argument is invalid.

◆ StartScreenCaptureByScreenRect()

int agora_gaming_rtc.IRtcEngine.StartScreenCaptureByScreenRect ( Rectangle  screenRectangle,
Rectangle  regionRectangle,
ScreenCaptureParameters  screenCaptureParameters 
)

Shares the whole or part of a screen by specifying the screen rect.

Note
This method is for Windows and macOS only.
Parameters
screenRectangleSets the relative location of the screen to the virtual screen.
regionRectangle(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.
screenCaptureParametersSets the screen sharing encoding parameters. See ScreenCaptureParameters.
Returns
  • 0: Success.
  • < 0: Failure.
    • ERR_INVALID_STATE: the screen sharing state is invalid, probably because another screen or window is being shared. Call StopScreenCapture to stop the current screen sharing.
    • ERR_INVALID_ARGUMENT(-2): the argument is invalid.

◆ SetScreenCaptureContentHint()

int agora_gaming_rtc.IRtcEngine.SetScreenCaptureContentHint ( VideoContentHint  videoContentHint)

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.

Note
This method is for Windows and macOS only.
Parameters
videoContentHintSets the content hint for screen sharing. See VideoContentHint.
Returns
  • 0: Success.
  • < 0: Failure.

◆ UpdateScreenCaptureParameters()

int agora_gaming_rtc.IRtcEngine.UpdateScreenCaptureParameters ( ScreenCaptureParameters  screenCaptureParameters)

Updates the screen sharing parameters.

Note
This method is for Windows and macOS only.
Parameters
screenCaptureParametersSets the screen sharing encoding parameters. See ScreenCaptureParameters.
Returns
  • 0: Success.
  • < 0: Failure.
    • ERR_NOT_READY(-3): no screen or windows is being shared.

◆ UpdateScreenCaptureRegion()

int agora_gaming_rtc.IRtcEngine.UpdateScreenCaptureRegion ( Rectangle  rectangle)

Updates the screen sharing region.

Note
This method is for Windows and macOS only.
Parameters
rectangleSets 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.
Returns
  • 0: Success.
  • < 0: Failure.
    • ERR_NOT_READY(-3): no screen or windows is being shared.

◆ StopScreenCapture()

int agora_gaming_rtc.IRtcEngine.StopScreenCapture ( )

Stop screen sharing.

Note
This method is for Windows and macOS only.
Returns
  • 0: Success.
  • < 0: Failure.

◆ AddInjectStreamUrl()

int agora_gaming_rtc.IRtcEngine.AddInjectStreamUrl ( string  url,
InjectStreamConfig  streamConfig 
)

Adds a voice or video stream URL address to a live broadcast.

The OnStreamPublishedHandler callback returns the inject status. If this method call is successful, the server pulls the voice or video stream and injects it into a live channel. This is applicable to scenarios where all audience members in the channel can watch a live show and interact with each other.

The AddInjectStreamUrl method call triggers the following callbacks:

  • The local client:
  • The remote client:
    • OnUserJoinedHandler (uid: 666), if the method call is successful and the online media stream is injected into the channel.
Note
  • Ensure that you enable the RTMP Converter service before using this function.
  • This method applies to the Native SDK v2.4.1 and later.
Parameters
urlThe URL address which is added to the ongoing live broadcast. Valid protocols are RTMP, HLS, and FLV.
  • Supported FLV audio codec type: AAC.
  • Supported FLV video codec type: H264 (AVC).
streamConfigThe InjectStreamConfig object that contains the configuration of the added voice or video stream.
Returns
  • 0: Success.
  • < 0: Failure. -ERR_INVALID_ARGUMENT(-2): The injected URL does not exist. Call this method again to inject the stream and ensure that the URL is valid. -ERR_NOT_READY(-3): The user is not in the channel. -ERR_NOT_SUPPORTED(-4): The channel profile is not live broadcast. Call the SetChannelProfile method and set the channel profile to live broadcast before calling this method. -ERR_NOT_INITIALIZED(-7): The SDK is not initialized. Ensure that the IRtcEngine object is initialized before calling this method.

◆ RemoveInjectStreamUrl()

int agora_gaming_rtc.IRtcEngine.RemoveInjectStreamUrl ( string  url)

Removes the voice or video stream URL address from a live broadcast.

This method removes the URL address (added by the AddInjectStreamUrl method) from the live broadcast.

Note
If this method is called successfully, the SDK triggers the OnUserOfflineHandler callback and returns a stream uid of 666.
Parameters
urlThe URL address of the added stream to be removed.
Returns
  • 0: Success.
  • < 0: Failure.

◆ EnableLoopbackRecording()

int agora_gaming_rtc.IRtcEngine.EnableLoopbackRecording ( bool  enabled,
string  deviceName 
)

Enables loopback recording.

If you enable loopback recording, the output of the sound card is mixed into the audio stream sent to the other end.

Note
  • This method is for macOS and Windows only.
  • macOS does not support loopback recording of the default sound card. If you need to use this method, please use a virtual sound card and pass its name to the deviceName parameter. Agora has tested and recommends using soundflower.
Parameters
enabledSets whether to enable/disable loopback recording.
  • true: Enable loopback recording.
  • false: (Default) Disable loopback recording.
deviceNameThe device name of the sound card. The default value is NULL (the default sound card).
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetAudioSessionOperationRestriction()

int agora_gaming_rtc.IRtcEngine.SetAudioSessionOperationRestriction ( AUDIO_SESSION_OPERATION_RESTRICTION  restriction)

Sets the audio session’s operational restriction.

The SDK and the app can both configure the audio session by default. The app may occasionally use other apps or third-party components to manipulate the audio session and restrict the SDK from doing so. This method allows the app to restrict the SDK’s manipulation of the audio session.

You can call this method at any time to return the control of the audio sessions to the SDK.

Note
  • This method is for iOS only.
  • This method restricts the SDK’s manipulation of the audio session. Any operation to the audio session relies solely on the app, other apps, or third-party components.
Parameters
restrictionThe operational restriction (bit mask) of the SDK on the audio session. See AUDIO_SESSION_OPERATION_RESTRICTION.
Returns
  • 0: Success.
  • < 0: Failure.

◆ StartChannelMediaRelay()

int agora_gaming_rtc.IRtcEngine.StartChannelMediaRelay ( ChannelMediaRelayConfiguration  mediaRelayConfiguration)

Starts to relay media streams across channels.

After a successful method call, the SDK triggers the OnChannelMediaRelayStateChangedHandler and OnChannelMediaRelayEventHandler callbacks, and these callbacks return the state and events of the media stream relay.

Note
  • Call this method after the JoinChannelByKey method.
  • This method takes effect only when you are a broadcaster in a Live-broadcast channel.
  • After a successful method call, if you want to call this method again, ensure that you call the StopChannelMediaRelay method to quit the current relay.
Parameters
mediaRelayConfigurationThe configuration of the media stream relay: ChannelMediaRelayConfiguration.
Returns
  • 0: Success.
  • < 0: Failure.

◆ UpdateChannelMediaRelay()

int agora_gaming_rtc.IRtcEngine.UpdateChannelMediaRelay ( ChannelMediaRelayConfiguration  mediaRelayConfiguration)

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 OnChannelMediaRelayEventHandler callback with the RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL(7) state code.

Note
Call this method after the StartChannelMediaRelay method to update the destination channel.
Parameters
mediaRelayConfigurationThe media stream relay configuration: ChannelMediaRelayConfiguration.
Returns
  • 0: Success.
  • < 0: Failure.

◆ StopChannelMediaRelay()

int agora_gaming_rtc.IRtcEngine.StopChannelMediaRelay ( )

Stops the media stream relay.

Once the relay stops, the broadcaster quits all the destination channels.

After a successful method call, the SDK triggers the OnChannelMediaRelayStateChangedHandler callback. If the callback returns RELAY_STATE_IDLE(0) and RELAY_OK(0), the broadcaster successfully stops the relay.

Note
If the method call fails, the SDK triggers the OnChannelMediaRelayStateChangedHandler callback with the RELAY_ERROR_SERVER_NO_RESPONSE(2) or RELAY_ERROR_SERVER_CONNECTION_LOST(8) state code. You can leave the channel by calling the LeaveChannel method, and the media stream relay automatically stops.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SwitchChannel()

int agora_gaming_rtc.IRtcEngine.SwitchChannel ( string  token,
string  channelId 
)

Switches to a different channel.

This method allows the audience of a Live-broadcast channel to switch to a different channel.

After the user successfully switches to another channel, the OnLeaveChannelHandler and OnJoinChannelSuccessHandler callbacks are triggered to indicate that the user has left the original channel and joined a new one.

Note
This method applies to the audience role in a Live-broadcast channel only.
Parameters
tokenThe token generated at your server:
  • For low-security requirements: You can use the temporary token generated in Console. For details, see Get a temporary token.
  • For high-security requirements: Use the token generated at your server. For details, see Get a token.
channelIdUnique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetMirrorApplied()

int agora_gaming_rtc.IRtcEngine.SetMirrorApplied ( bool  wheatherApply)

Sets whether to enable the mirror mode of both local video and remote video.

Note
Call this method before EnableVideoObserver.
Parameters
wheatherApplySets whether to enable the mirror mode of both local video and remote video.
  • true: Enable.
  • false: (Default) Disable.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetInEarMonitoringVolume()

int agora_gaming_rtc.IRtcEngine.SetInEarMonitoringVolume ( int  volume)

Sets the volume of the in-ear monitor.

Note
This method is for Android and iOS only.
Parameters
volumeSets the volume of the in-ear monitor. The value ranges between 0 and 100 (default).
Returns
  • 0: Success.
  • < 0: Failure.

◆ StartScreenCaptureByWindowId()

int agora_gaming_rtc.IRtcEngine.StartScreenCaptureByWindowId ( int  windowId,
Rectangle  regionRect,
ScreenCaptureParameters  screenCaptureParameters 
)

Shares the whole or part of a window by specifying the window ID.

Note
This method is for Windows and macOS only.
Parameters
windowIdThe ID of the window to be shared.
regionRect(Optional) The relative location of the region to the window. NULL 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.
screenCaptureParametersWindow sharing encoding parameters. See ScreenCaptureParameters.
Returns
  • 0: Success.
  • < 0: Failure.
    • ERR_INVALID_STATE: the window sharing state is invalid, probably because another screen or window is being shared. Call StopScreenCapture to stop sharing the current window.
    • ERR_INVALID_ARGUMENT(-2): the argument is invalid.

◆ EnableInEarMonitoring()

int agora_gaming_rtc.IRtcEngine.EnableInEarMonitoring ( bool  enabled)

Enables in-ear monitoring.

Note
This method is only for Android and iOS.
Parameters
enabledSets whether to enable/disable in-ear monitoring:
  • true: Enable.
  • false: (Default) Disable.
Returns
  • 0: Success.
  • < 0: Failure.

◆ GetEngine()

static IRtcEngine agora_gaming_rtc.IRtcEngine.GetEngine ( string  appId)
static

Initializes the IRtcEngine.

Parameters
appIdThe App ID of your project.
Returns
The IRtcEngine instance.

◆ getEngine()

static IRtcEngine agora_gaming_rtc.IRtcEngine.getEngine ( string  appId)
static

Initializes the IRtcEngine.

Deprecated:
Use GetEngine instead.
Parameters
appIdThe App ID of your project.
Returns
The IRtcEngine instance.

◆ Destroy()

static void agora_gaming_rtc.IRtcEngine.Destroy ( )
static

Destroys the IRtcEngine instance and releases all resources used by the Agora RTC SDK.

This method is useful for apps that occasionally make voice or video calls, to free up resources for other operations when not making calls.

Note
  • Call this method in the subthread.
  • Once the app calls Destroy to destroy the created IRtcEngine instance, you cannot use any method or callback in the SDK.