Video SDK v3.7.1 API Reference for Unity
|
Inherits IRtcEngineNative.
Static Public Member Functions | |
static string | GetSdkVersion () |
static string | GetErrorDescription (int code) |
static IRtcEngine | GetEngine (string appId) |
static IRtcEngine | GetEngine (RtcEngineConfig engineConfig) |
static IRtcEngine | getEngine (string appId) |
static void | Destroy () |
static IRtcEngine | QueryEngine () |
The definition of IRtcEngine.
bool agora_gaming_rtc.IRtcEngine.GetInitStatus | ( | ) |
string agora_gaming_rtc.IRtcEngine.doFormat | ( | string | format, |
params object[] | args | ||
) |
|
static |
Gets the SDK version.
int agora_gaming_rtc.IRtcEngine.SetChannelProfile | ( | CHANNEL_PROFILE | profile | ) |
Sets the channel profile of the Agora IRtcEngine.
The Agora IRtcEngine differentiates channel profiles and applies optimization algorithms accordingly. For example, it prioritizes smoothness and low latency for a video call, and prioritizes video quality for a video broadcast.
profile | The channel profile of the Agora IRtcEngine. See CHANNEL_PROFILE. |
int agora_gaming_rtc.IRtcEngine.SetClientRole | ( | CLIENT_ROLE_TYPE | role | ) |
Sets the role of the user, such as a host or an audience (default), before joining a channel in the interactive live streaming.
This method can be used to switch the user role in the interactive live streaming after the user joins a channel.
You can call this method either before or after joining a channel. If you call this method to switch the user role after joining a channel, the SDK automatically does the following:
MuteLocalAudioStream
and MuteLocalVideoStream
to change the publishing state.OnClientRoleChangedHandler
or OnClientRoleChangeFailedHandler
on the local client.OnUserJoinedHandler
or OnUserOfflineHandler(BECOME_AUDIENCE)
on the remote client.role | Sets the role of the user. See CLIENT_ROLE_TYPE. |
int agora_gaming_rtc.IRtcEngine.SetLogFilter | ( | LOG_FILTER | filter | ) |
Sets the output log level of the SDK.
logConfig
in the GetEngine method instead.You can use one or a combination of the log filter levels. The log level follows the sequence of OFF, CRITICAL, ERROR, WARNING, INFO, and DEBUG. Choose a level to see the logs preceding that level.
For example, when you set the log level to WARNING, you can see the logs within levels CRITICAL, ERROR, and WARNING.
filter | Sets the log filter level. See LOG_FILTER. |
int agora_gaming_rtc.IRtcEngine.SetLogFile | ( | string | filePath | ) |
Sets the log files that the SDK outputs.
logConfig
in the GetEngine method instead.By default, the SDK outputs five log files, agorasdk.log
, agorasdk_1.log
, agorasdk_2.log
, agorasdk_3.log
, agorasdk_4.log
, each with a default size of 1024 KB. These log files are encoded in UTF-8. The SDK writes the latest logs in agorasdk.log
. When agorasdk.log
is full, the SDK deletes the log file with the earliest modification time among the other four, renames agorasdk.log
to the name of the deleted log file, and create a new agorasdk.log
to record latest logs.
filePath | The absolute path of log files. The default file path is C: \Users\<user_name>\AppData\Local\Agora\<process_name>\agorasdk.log . Ensure that the directory for the log files exists and is writable. You can use this parameter to rename the log files. |
int agora_gaming_rtc.IRtcEngine.SetDefaultEngineSettings | ( | ) |
int agora_gaming_rtc.IRtcEngine.JoinChannel | ( | string | channelName, |
string | info = "" , |
||
uint | uid = 0 |
||
) |
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:
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.channelName | The unique channel name for the Agora RTC session in the string format smaller than 64 bytes. Supported characters:
|
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. |
ERR_INVALID_ARGUMENT(-2)
ERR_NOT_READY(-3)
ERR_REFUSED(-5)
int agora_gaming_rtc.IRtcEngine.JoinChannelByKey | ( | string | channelKey, |
string | channelName, | ||
string | info = "" , |
||
uint | uid = 0 |
||
) |
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:
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.
Once the user joins the channel, the user subscribes to the audio and video streams of all the other users in the channel by default, giving rise to usage and billing calculation. If you do not want to subscribe to a specified stream or all remote streams, call the mute
methods accordingly.
uid
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.channelKey | The token generated by the application server. In most circumstances, a static App ID suffices. For added security, use a Channel Key.
|
channelName | The unique channel name for the Agora RTC session in the string format smaller than 64 bytes. Supported characters:
|
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. |
AgoraChannel
object with the same channel name.AgoraChannel
object. 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.
token | The new token. |
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:
OnLeaveChannelHandler
LeaveChannel
method, the LeaveChannel
process interrupts, and the OnLeaveChannelHandler
callback is not triggered.LeaveChannel
method during a CDN live streaming, the SDK triggers the RemovePublishStreamUrl method.void agora_gaming_rtc.IRtcEngine.Pause | ( | ) |
void agora_gaming_rtc.IRtcEngine.Resume | ( | ) |
int agora_gaming_rtc.IRtcEngine.SetParameters | ( | string | parameters | ) |
Provides the technical preview functionalities or special customizations by configuring the SDK with JSON options.
parameters | The set parameters in a JSON string. |
int agora_gaming_rtc.IRtcEngine.SetParameter | ( | string | parameter, |
int | value | ||
) |
int agora_gaming_rtc.IRtcEngine.SetParameter | ( | string | parameter, |
double | value | ||
) |
int agora_gaming_rtc.IRtcEngine.SetParameter | ( | string | parameter, |
bool | value | ||
) |
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.
int agora_gaming_rtc.IRtcEngine.Rate | ( | string | callId, |
int | rating, | ||
string | desc = "" |
||
) |
Allows a user to rate a call after the call ends.
callId | The ID of the call, retrieved from the GetCallId method. |
rating | Rating of the call. The value is between 1 (lowest score) and 5 (highest score). If you set a value out of this range, the ERR_INVALID_ARGUMENT(2) error returns. |
desc | (Optional) The description of the rating, with a string length of less than 800 bytes. |
int agora_gaming_rtc.IRtcEngine.Complain | ( | string | callId, |
string | desc = "" |
||
) |
Allows a user to complain about the call quality after a call ends.
callId | The 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. |
int agora_gaming_rtc.IRtcEngine.EnableAudio | ( | ) |
Enables the audio module.
The audio mode is enabled by default.
int agora_gaming_rtc.IRtcEngine.DisableAudio | ( | ) |
Disables the audio module.
int agora_gaming_rtc.IRtcEngine.MuteLocalAudioStream | ( | bool | mute | ) |
Stops or resumes publishing the local audio stream.
mute
is set as true, this method does not affect any ongoing audio recording, because it does not disable the microphone.SetChannelProfile
method.mute | Sets whether to stop publishing the local audio stream.
|
int agora_gaming_rtc.IRtcEngine.MuteAllRemoteAudioStreams | ( | bool | mute | ) |
Stops or resumes subscribing to the audio streams of all remote users.
As of v3.3.1, after successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users.
mute | Sets whether to stop subscribing to the audio streams of all remote users.
|
int agora_gaming_rtc.IRtcEngine.MuteRemoteAudioStream | ( | uint | uid, |
bool | mute | ||
) |
Stops or resumes subscribing to the audio stream of a specified user.
uid | The user ID of the specified remote user. |
mute | Sets whether to stop subscribing to the audio stream of a specified user.
|
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.
On Android, settings of SetAudioProfile and SetChannelProfile affect the call result of SetEnableSpeakerphone
. The following are scenarios where SetEnableSpeakerphone
does not take effect:
scenario
as AUDIO_SCENARIO_GAME_STREAMING
, no user can change the audio playback route.scenario
as AUDIO_SCENARIO_DEFAULT
or AUDIO_SCENARIO_SHOWROOM
, the audience cannot change the audio playback route. If there is only one host is in the channel, the host cannot change the audio playback route either.scenario
as AUDIO_SCENARIO_EDUCATION
, the audience cannot change the audio playback route.speakerphone | Sets whether to route the audio to the speakerphone or earpiece:
|
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 profile:
speakerphone | Sets the default audio route:
|
bool agora_gaming_rtc.IRtcEngine.IsSpeakerphoneEnabled | ( | ) |
Checks whether the speakerphone is enabled.
int agora_gaming_rtc.IRtcEngine.SwitchCamera | ( | ) |
Switches between front and rear cameras.
int agora_gaming_rtc.IRtcEngine.SetVideoProfile | ( | VIDEO_PROFILE_TYPE | profile, |
bool | swapWidthAndHeight = false |
||
) |
Sets the video profile.
Each video profile includes a set of parameters, such as the resolution, frame rate, and bitrate. If the camera device does not support the specified resolution, the SDK automatically chooses a suitable camera resolution, keeping the encoder resolution specified by the setVideoProfile
method.
profile | Sets the video profile. See VIDEO_PROFILE_TYPE. |
swapWidthAndHeight | Sets whether to swap the width and height of the video stream:
|
int agora_gaming_rtc.IRtcEngine.MuteLocalVideoStream | ( | bool | mute | ) |
Stops or resumes publishing the local video stream.
A successful MuteLocalVideoStream
method call triggers the OnUserMuteVideoHandler callback on the remote client.
mute
is set as true
, this method does not affect any ongoing video recording, because it does not disable the camera.SetChannelProfile
method.mute | Sets whether to stop publishing the local video stream.
|
int agora_gaming_rtc.IRtcEngine.MuteAllRemoteVideoStreams | ( | bool | mute | ) |
Stops or resumes subscribing to the video streams of all remote users.
As of v3.3.1, after successfully calling this method, the local user stops or resumes subscribing to the video streams of all remote users, including all subsequent users.
mute | Sets whether to stop subscribing to the video streams of all remote users.
|
int agora_gaming_rtc.IRtcEngine.MuteRemoteVideoStream | ( | uint | uid, |
bool | mute | ||
) |
Stops or resumes subscribing to the video stream of a specified user.
uid | The user ID of the specified remote user. |
mute | Sets whether to stop subscribing to the video stream of a specified user.
|
int agora_gaming_rtc.IRtcEngine.EnableDualStreamMode | ( | bool | enabled | ) |
Sets the stream mode to the single-stream (default) or dual-stream mode. (Interactive live streaming 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).
enabled | Sets the stream mode:
|
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.
encryptionMode | The set encryption mode:
|
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.
secret | The encryption password. |
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.
reliable
as true
while setting ordered
as false
.reliable | Sets whether or not the recipients are guaranteed to receive the data stream from the sender within five seconds:
|
ordered | Sets whether or not the recipients receive the data stream in the sent order:
|
int agora_gaming_rtc.IRtcEngine.CreateDataStream | ( | DataStreamConfig | config | ) |
Creates a data stream.
Each user can create up to five data streams in a single channel.
This method does not support data reliability. If the receiver receives a data packet five seconds or more after it was sent, the SDK directly discards the data.
config | The configurations for the data stream: DataStreamConfig. |
int agora_gaming_rtc.IRtcEngine.SendStreamMessage | ( | int | streamId, |
byte[] | data | ||
) |
Sends data stream messages to all users in a channel.
The SDK has the following restrictions on this method:
A successful SendStreamMessage method call triggers the 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.
streamId | ID of the sent data stream, returned in the CreateDataStream method. |
data | The sent data. |
int agora_gaming_rtc.IRtcEngine.SetSpeakerphoneVolume | ( | int | volume | ) |
Set the volume of the speaker. (macOS only.)
volume | Sets the speakerphone volume. The value ranges between 0 (lowest volume) and 255 (highest volume). |
int agora_gaming_rtc.IRtcEngine.SetVideoQualityParameters | ( | bool | preferFrameRateOverImageQuality | ) |
Sets the preferences for the high-quality video. (Interactive live streaming only).
preferFrameRateOverImageQuality | Sets the video quality preference:
|
int agora_gaming_rtc.IRtcEngine.StartEchoTest | ( | ) |
Starts an audio call test.
This method starts an audio call test to check whether the audio devices (for example, headset and speaker) and the network connection are working properly.
To conduct the test:
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 capturing plays back within the set time interval, the audio devices and the network connection are working properly.
intervalInSeconds | The time interval (sec) between when you speak and when the capturing plays back. |
int agora_gaming_rtc.IRtcEngine.StartEchoTest | ( | EchoTestConfiguration | config | ) |
Starts an audio and video call loop test.
Before joining a channel, to test whether the user's local sending and receiving streams are normal, you can call this method to perform an audio and video call loop test, which tests whether the audio and video devices and the user's upstream and downstream networks are working properly.
After starting the test, the user needs to make a sound or face the camera. The audio or video is output after about two seconds. If the audio playback is normal, the audio device and the user's upstream and downstream networks are working properly; if the video playback is normal, the video device and the user's upstream and downstream networks are working properly.
LIVE_BROADCASTING
profile, only a host can call this method.config | The configuration of the audio and video call loop test, see EchoTestConfiguration. |
int agora_gaming_rtc.IRtcEngine.StopEchoTest | ( | ) |
Stops the audio call test.
int agora_gaming_rtc.IRtcEngine.StartLastmileProbeTest | ( | LastmileProbeConfig | lastmileProbeConfig | ) |
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).
Once this method is enabled, the SDK returns the following callbacks:
Call this method to check the uplink network quality before users join a channel or before an audience switches to a host.
OnLastmileQualityHandler
and OnLastmileProbeResultHandler
callbacks. Otherwise, the callbacks may be interrupted.lastmileProbeConfig | Sets the configurations of the last-mile network probe test. See LastmileProbeConfig. |
int agora_gaming_rtc.IRtcEngine.StopLastmileProbeTest | ( | ) |
Stops the last-mile network probe test.
int agora_gaming_rtc.IRtcEngine.AddVideoWatermark | ( | RtcImage | rtcImage | ) |
Adds a watermark image to the local video or CDN live stream.
This method adds a PNG watermark image to the local video stream for the capturing device, channel audience, and CDN live audience to view and capture.
To add the PNG file to the CDN live publishing stream, see the SetLiveTranscoding method.
rtcImage | The watermark image to be added to the local video stream. See RtcImage. |
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 the interactive live streaming. Once the watermark image is added, all the audience in the channel (CDN audience included), and the capturing device can see and capture it. Agora supports adding only one watermark image onto the local video, and the newly watermark image replaces the previous one.
The watermark position depends on the settings in the SetVideoEncoderConfiguration method:
setVideoEncoderConfiguration
method. Otherwise, the watermark image will be cropped.visibleInPreview
member in the WatermarkOptions class to set whether or not the watermark is visible in preview.watermarkUrl | The local file path of the watermark image to be added. This method supports adding a watermark image from the local absolute or relative file path. |
watermarkOptions | The watermark's options to be added. See WatermarkOptions for more infomation. |
int agora_gaming_rtc.IRtcEngine.ClearVideoWatermarks | ( | ) |
Removes the watermark image from the video stream added by the AddVideoWatermark method.
int agora_gaming_rtc.IRtcEngine.SetRemoteVideoStreamType | ( | uint | uid, |
REMOTE_VIDEO_STREAM_TYPE | streamType | ||
) |
Sets the stream type of the remote video.
Under limited network conditions, if the publisher has not disabled the dual-stream mode using EnableDualStreamMode(false), the receiver can choose to receive either the high-quality video stream (the high resolution, and high bitrate video stream) or the low-video stream (the low resolution, and low bitrate video stream).
By default, users receive the high-quality video stream. Call this method if you want to switch to the low-video stream. This method allows the app to adjust the corresponding video stream type based on the size of the video window to reduce the bandwidth and resources.
The aspect ratio of the low-video stream is the same as the high-quality video stream. Once the resolution of the high-quality video stream is set, the system automatically sets the resolution, frame rate, and bitrate of the low-video stream.
The method result returns in the OnApiExecutedHandler callback.
SetRemoteVideoStreamType
and SetRemoteDefaultVideoStreamType, the SDK applies the settings in the SetRemoteVideoStreamType
.uid | ID of the remote user sending the video stream. |
streamType | Sets the video-stream type. See REMOTE_VIDEO_STREAM_TYPE. |
int agora_gaming_rtc.IRtcEngine.SetMixedAudioFrameParameters | ( | int | sampleRate, |
int | samplesPerCall | ||
) |
Sets the mixed audio format for the OnMixedAudioFrameHandler callback.
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.sampleRate | Sets the sample rate (samplesPerSec ) returned in the OnMixedAudioFrameHandler callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
samplesPerCall | Sets the number of samples the OnMixedAudioFrameHandler callback returns. Set it as 1024 for RTMP or RTMPS streaming. |
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).
pos | The playback starting position (ms) of the music file. |
int agora_gaming_rtc.IRtcEngine.EnableAudioVolumeIndication | ( | int | interval, |
int | smooth, | ||
bool | report_vad = false |
||
) |
Enables the reporting of users' volume indication.
This method enables the SDK to regularly report the volume information of the local user who sends a stream and remote users (up to three) whose instantaneous volumes are the highest to the app. Once you call this method and users send streams in the channel, the SDK triggers the OnVolumeIndicationHandler callback at the time interval set in this method.
interval | Sets the time interval between two consecutive volume indications:
|
smooth | Smoothing factor sets the sensitivity of the audio volume indicator. The value ranges between 0 and 10. The greater the value, the more sensitive the indicator. The recommended value is 3. |
report_vad |
|
int agora_gaming_rtc.IRtcEngine.AdjustRecordingSignalVolume | ( | int | volume | ) |
Adjusts adjust the capturing signal volume.
volume | Recording volume. To avoid echoes and improve call quality, Agora recommends setting the value of volume between 0 and 100. If you need to set the value higher than 100, contact suppo first. rt@a gora. io
|
int agora_gaming_rtc.IRtcEngine.AdjustPlaybackSignalVolume | ( | int | volume | ) |
Adjusts the playback signal volume of all remote users.
AdjustPlaybackSignalVolume
and AdjustAudioMixingVolume, and set volume
as 0.volume | the playback signal volume of all remote users. To avoid echoes and improve call quality, Agora recommends setting the value of volume between 0 and 100. If you need to set the value higher than 100, contact suppo first. rt@a gora. io
|
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.
WARN_AUDIO_MIXING_OPEN_ERROR(701)
.filePath
as an HTTP URL, ensure that you add android:usesCleartextTraffic="true"
in the <application>
tag in the project AndroidManifest.xml file.filePath | The absolute path (including the suffixes of the filename) of the local or online audio file to mix. Supported audio formats: mp3, mp4, m4a, aac, 3gp, mkv and wav. For more information, see Supported Media Formats in Media Foundation. |
loopback | Sets which user can hear the audio mixing:
|
replace | Sets the audio mixing content:
|
cycle | Sets the number of playback loops:
|
int agora_gaming_rtc.IRtcEngine.StartAudioMixing | ( | string | filePath, |
bool | loopback, | ||
bool | replace, | ||
int | cycle, | ||
int | startPos | ||
) |
Starts playing and mixing the music file.
This method supports mixing or replacing local or online music file and audio collected by a microphone. After successfully playing the music file, the SDK triggers OnAudioMixingStateChangedHandler(AUDIO_MIXING_STATE_PLAYING, AUDIO_MIXING_REASON_STARTED_BY_USER). After completing playing the music file, the SDK triggers OnAudioMixingStateChangedHandler(AUDIO_MIXING_STATE_STOPPED, AUDIO_MIXING_REASON_ALL_LOOPS_COMPLETED).
filePath
as an HTTP URL, ensure that you add android:usesCleartextTraffic="true"
in the <application>
tag in the project AndroidManifest.xml file.WARN_AUDIO_MIXING_OPEN_ERROR(701)
.filePath | The file path, including the filename extensions. To access an online file, Agora supports using a URL address; to access a local file, Agora supports using a URI address, an absolute path, or a path that starts with /assets/. |
loopback | Whether to only play the music file on the local client:
|
replace | Whether to replace the audio collected by the microphone with a music file:
|
cycle | The number of times the music file plays.
|
startPos | The playback position (ms) of the music file. |
int agora_gaming_rtc.IRtcEngine.StopAudioMixing | ( | ) |
Stops playing and mixing the music file.
Call this method when you are in a channel.
int agora_gaming_rtc.IRtcEngine.PauseAudioMixing | ( | ) |
Pauses playing and mixing the music file.
Call this method when you are in a channel.
int agora_gaming_rtc.IRtcEngine.ResumeAudioMixing | ( | ) |
Resumes playing and mixing the music file.
Call this method when you are in a channel.
int agora_gaming_rtc.IRtcEngine.AdjustAudioMixingVolume | ( | int | volume | ) |
Adjusts the volume during audio mixing.
Call this method when you are in a channel.
volume | Audio mixing volume. The value ranges between 0 and 100.
|
int agora_gaming_rtc.IRtcEngine.GetAudioMixingDuration | ( | ) |
Retrieves the duration (ms) of the music file.
Call this method when you are in a channel.
int agora_gaming_rtc.IRtcEngine.GetAudioMixingDuration | ( | string | filePath | ) |
Gets the total duration of the music file.
filePath | The absolute path (including the filename extensions) of the local music file. For example: C:\music\audio.mp4 . Supported audio formats include MP3, AAC, M4A, MP4, WAV, and 3GP. For more information, see Supported Media Formats in Media Foundation. When you access a local file on Android, Agora recommends passing a URI address or the path starts with /assets/ in this parameter. |
int agora_gaming_rtc.IRtcEngine.GetAudioMixingCurrentPosition | ( | ) |
Retrieves the playback position (ms) of the music file.
Call this method when you are in a channel.
int agora_gaming_rtc.IRtcEngine.StartAudioRecording | ( | string | filePath, |
AUDIO_RECORDING_QUALITY_TYPE | quality | ||
) |
Starts an audio recording.
The SDK allows recording during a call. Supported formats:
This method has a fixed sample rate of 32 kHz.
filePath | Pointer to the absolute file path of the recording file. The string of the file name is in UTF-8. |
quality | Sets the audio recording quality. See AUDIO_RECORDING_QUALITY_TYPE. |
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:
sampleRate
is 44100 Hz or 48000 Hz.filePath | Pointer to the absolute file path of the recording file. The string of the file name is in UTF-8. |
sampleRate | Sample rate (Hz) of the recording file. Supported values are as follows:
|
quality | Sets the audio recording quality. See AUDIO_RECORDING_QUALITY_TYPE. |
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.
IAudioEffectManager agora_gaming_rtc.IRtcEngine.GetAudioEffectManager | ( | ) |
Retrieves the AudioEffectManagerImpl object.
IAudioRecordingDeviceManager agora_gaming_rtc.IRtcEngine.GetAudioRecordingDeviceManager | ( | ) |
Retrieves the AudioRecordingDeviceManager object.
IAudioPlaybackDeviceManager agora_gaming_rtc.IRtcEngine.GetAudioPlaybackDeviceManager | ( | ) |
Retrieves the AudioPlaybackDeviceManager object.
IVideoDeviceManager agora_gaming_rtc.IRtcEngine.GetVideoDeviceManager | ( | ) |
Retrieves the VideoDeviceManager object.
IAudioRawDataManager agora_gaming_rtc.IRtcEngine.GetAudioRawDataManager | ( | ) |
Retrieves the AudioRawDataManager object.
IVideoRawDataManager agora_gaming_rtc.IRtcEngine.GetVideoRawDataManager | ( | ) |
Retrieves the VideoRawDataManager object.
IScreenCaptureManager agora_gaming_rtc.IRtcEngine.GetScreenCaptureManager | ( | ) |
IMediaRecorder agora_gaming_rtc.IRtcEngine.GetMediaRecorder | ( | ) |
ILocalSpatialAudioEngine agora_gaming_rtc.IRtcEngine.GetLocalSpatialAudioEngine | ( | ) |
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.
EnableVideo
and EnableVideoObserver methods.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.
DisableVideo
and DisableVideoObserver methods.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.
enabled | Sets whether to disable/re-enable the local video, including the capturer, renderer, and sender:
|
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.
Once the local audio function is disabled or re-enabled, the SDK triggers the OnLocalAudioStateChangedHandler callback, which reports LOCAL_AUDIO_STREAM_STATE_STOPPED(0)
or LOCAL_AUDIO_STREAM_STATE_RECORDING(1)
.
EnableLocalAudio
: Disables/Re-enables the local audio capturing and processing. If you disable or re-enable local audio capturing using the EnableLocalAudio
method, the local user may hear a pause in the remote audio playback.MuteLocalAudioStream
: Sends/Stops sending the local audio streams.enabled | Sets whether to disable/re-enable the local audio function:
|
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.
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.int agora_gaming_rtc.IRtcEngine.StopPreview | ( | ) |
Stops the local video preview and disables video.
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.
EnableVideoObserver
methods.int agora_gaming_rtc.IRtcEngine.DisableVideoObserver | ( | ) |
Disables the video observer.
This method disables sending video directly to the app.
DisableVideoObserver
methods.int agora_gaming_rtc.IRtcEngine.SetDefaultMuteAllRemoteAudioStreams | ( | bool | mute | ) |
Stops or resumes subscribing to the audio streams of all remote users by default.
Call this method after joining a channel. After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all subsequent users.
SetDefaultMuteAllRemoteAudioStreams(true)
, do the following.mute | Sets whether to stop subscribing to the audio streams of all remote users by default.
|
int agora_gaming_rtc.IRtcEngine.SetDefaultMuteAllRemoteVideoStreams | ( | bool | mute | ) |
Stops or resumes subscribing to the video streams of all remote users by default.
Call this method after joining a channel. After successfully calling this method, the local user stops or resumes subscribing to the video streams of all subsequent users.
SetDefaultMuteAllRemoteVideoStreams(true)
, do the following.mute | Sets whether to stop subscribing to the video streams of all remote users by default.
|
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.
OnLastmileQualityHandler
callback. Otherwise, the callback may be interrupted by other methods, and hence may not be triggered.int agora_gaming_rtc.IRtcEngine.DisableLastmileTest | ( | ) |
Disables the network connection quality test.
CONNECTION_STATE_TYPE agora_gaming_rtc.IRtcEngine.GetConnectionState | ( | ) |
Retrieves the connection state of the SDK.
int agora_gaming_rtc.IRtcEngine.SetAudioProfile | ( | AUDIO_PROFILE_TYPE | audioProfile, |
AUDIO_SCENARIO_TYPE | scenario | ||
) |
Sets the audio parameters and application scenarios.
SetAudioProfile
method must be called before the JoinChannelByKey method.audioProfile | Sets the sample rate, bitrate, encoding mode, and the number of channels. See AUDIO_PROFILE_TYPE. |
scenario | Sets the audio application scenario. See AUDIO_SCENARIO_TYPE. Under different audio scenarios, the device uses different volume 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?. |
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.
configuration | Sets the local video encoder configuration. See VideoEncoderConfiguration. |
int agora_gaming_rtc.IRtcEngine.AdjustAudioMixingPlayoutVolume | ( | int | volume | ) |
Adjusts the audio mixing volume for local playback.
volume | Audio mixing volume for local playback. The value ranges between 0 and 100 (default). |
int agora_gaming_rtc.IRtcEngine.AdjustAudioMixingPublishVolume | ( | int | volume | ) |
Adjusts the audio mixing volume for publishing (for remote users).
volume | Audio mixing volume for publishing. The value ranges between 0 and 100 (default). |
int agora_gaming_rtc.IRtcEngine.SetVolumeOfEffect | ( | int | soundId, |
int | volume | ||
) |
Sets the volume of a specified audio effect.
soundId | ID of the audio effect. Each audio effect has a unique ID. |
volume | Sets the volume of the specified audio effect. The value ranges between 0 and 100 (default). |
int agora_gaming_rtc.IRtcEngine.SetRecordingAudioFrameParameters | ( | int | sampleRate, |
int | channel, | ||
RAW_AUDIO_FRAME_OP_MODE_TYPE | mode, | ||
int | samplesPerCall | ||
) |
Sets the audio capturing format for the OnRecordAudioFrameHandler callback.
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.sampleRate | Sets the sample rate returned in the OnRecordAudioFrameHandler callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
channel | Sets the number of audio channels returned in the OnRecordAudioFrameHandler callback:
|
mode | Sets the use mode (see RAW_AUDIO_FRAME_OP_MODE_TYPE) of the OnRecordAudioFrameHandler callback. |
samplesPerCall | Sets the number of samples the OnRecordAudioFrameHandler callback returns. Set it as 1024 for RTMP or RTMPS streaming. |
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.
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.sampleRate | Sets the sample rate returned in the OnPlaybackAudioFrameHandler callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
channel | Sets the number of channels returned in the OnPlaybackAudioFrameHandler callback:
|
mode | Sets the use mode (see RAW_AUDIO_FRAME_OP_MODE_TYPE) of the OnPlaybackAudioFrameHandler callback. |
samplesPerCall | Sets the number of samples the OnPlaybackAudioFrameHandler callback returns. Set it as 1024 for RTMP or RTMPS streaming. |
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:
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.
option | Sets the fallback option for the locally published video stream. See STREAM_FALLBACK_OPTIONS. |
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.
option | Sets the fallback option for the remotely subscribed video stream. See STREAM_FALLBACK_OPTIONS. |
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.
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.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.
SetRemoteDefaultVideoStreamType
and SetRemoteVideoStreamType, the SDK applies the settings in the SetRemoteVideoStreamType
.remoteVideoStreamType | Sets the default video-stream type. See REMOTE_VIDEO_STREAM_TYPE. |
int agora_gaming_rtc.IRtcEngine.AddPublishStreamUrl | ( | string | url, |
bool | transcodingEnabled | ||
) |
Publishes the local stream to a specified CDN streaming URL. (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.
url | The CDN streaming URL in the RTMP or RTMPS format. The maximum length of this parameter is 1024 bytes. The CDN streaming URL must not contain special characters, such as Chinese language characters. |
transcodingEnabled | Sets whether transcoding is enabled/disabled:
|
ERR_INVALID_ARGUMENT(-2)
: The CDN streaming URL is null
or has a string length of 0.ERR_NOT_INITIALIZED(-7)
: You have not initialized the RTC engine when publishing the stream. int agora_gaming_rtc.IRtcEngine.RemovePublishStreamUrl | ( | string | url | ) |
Removes an RTMP or RTMPS stream from the CDN. (CDN live only.)
This method removes the CDN streaming URL (added by the AddPublishStreamUrl method) from a CDN live stream. The SDK returns the result of this method call in the OnStreamUnpublishedHandler callback.
The RemovePublishStreamUrl
method call triggers the OnRtmpStreamingStateChangedHandler callback on the local client to report the state of removing an RTMP or RTMPS stream from the CDN.
url | The CDN streaming URL to be removed. The maximum length of this parameter is 1024 bytes. |
|
static |
Retrieves the description of a warning or error code.
code | The warning or error code that the OnSDKWarningHandler or OnSDKErrorHandler callback returns. |
int agora_gaming_rtc.IRtcEngine.EnableWebSdkInteroperability | ( | bool | enabled | ) |
Enables interoperability with the Agora Web SDK.
enabled | Sets whether to enable/disable interoperability with the Agora Web SDK:
|
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.
SetLiveTranscoding
method to update the transcoding setting for the first time, the SDK does not trigger the OnTranscodingUpdatedHandler
callback.transcoding | Sets the CDN live audio/video transcoding settings. See LiveTranscoding. |
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.
externalVideoFrame | Video frame to be pushed. See ExternalVideoFrame. |
int agora_gaming_rtc.IRtcEngine.SetExternalVideoSource | ( | bool | enable, |
bool | useTexture = false |
||
) |
Configures the external video source.
enable | Sets whether to use the external video source:
|
useTexture | Sets whether to use texture as an input (Agora does not support texture now, please use false ):
|
int agora_gaming_rtc.IRtcEngine.SetExternalAudioSource | ( | bool | enabled, |
int | sampleRate, | ||
int | channels | ||
) |
Sets the external audio source. Please call this method before JoinChannelByKey.
enabled | Sets whether to enable/disable the external audio source:
|
sampleRate | Sets the sample rate (Hz) of the external audio source, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
channels | Sets the number of audio channels of the external audio source:
|
int agora_gaming_rtc.IRtcEngine.PushAudioFrame | ( | AudioFrame | audioFrame | ) |
Pushes the raw data as the external audio frame into the channel.
For more information, see Custom Audio Source and Renderer in the Advanced Features of the Docs section.
audioFrame | The audio frame: AudioFrame. |
int agora_gaming_rtc.IRtcEngine.PushAudioFrame | ( | int | sourcePos, |
AudioFrame | audioFrame | ||
) |
Pushes the external audio frame to a specified position.
According to your needs, you can push the external audio frame to one of three positions: after audio capture, before audio encoding, or before local playback. You can call this method multiple times to push one audio frame to multiple positions or multiple audio frames to different positions. For example, in the KTV scenario, you can push the singing voice to after audio capture, so that the singing voice can be processed by the SDK audio module and you can obtain a high-quality audio experience; you can also push the accompaniment to before audio encoding, so that the accompaniment is not affected by the audio module of the SDK.
sourcePos | The push position of the external audio frame. |
audioFrame | The external audio frame. The value range of the audio frame length (ms) is [10,60]. |
-2(ERR_INALID_ARGUMENT)
: The parameter is invalid.-12 (ERR_TOO_OFTEN)
: The call frequency is too high, causing the internal buffer to overflow. Call this method again after 30-50 ms. int agora_gaming_rtc.IRtcEngine.GetAudioMixingPlayoutVolume | ( | ) |
Retrieves the audio mixing volume for local playback.
This method helps troubleshoot audio volume related issues.
int agora_gaming_rtc.IRtcEngine.GetAudioMixingPublishVolume | ( | ) |
Retrieves the audio mixing volume for publishing.
This method helps troubleshoot audio volume related issues.
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.
enabled | Sets whether or not to enable stereo panning for remote users:
|
int agora_gaming_rtc.IRtcEngine.SetLocalVoiceChanger | ( | VOICE_CHANGER_PRESET | voiceChanger | ) |
Sets the local voice changer option.
VOICE_CHANGER_XXX
: Changes the local voice to an old man, a little boy, or the Hulk. Applies to the voice talk scenario.VOICE_BEAUTY_XXX
: Beautifies the local voice by making it sound more vigorous, resounding, or adding spacial resonance. Applies to the voice talk and singing scenario.GENERAL_BEAUTY_VOICE_XXX
: Adds gender-based beautification effect to the local voice. Applies to the voice talk scenario.AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)
or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)
.voiceChanger | Sets the local voice changer option. The default value is VOICE_CHANGER_OFF , which means the original voice. See details in VOICE_CHANGER_PRESET. Gender-based beatification effect works best only when assigned a proper gender:
|
int agora_gaming_rtc.IRtcEngine.SetLocalVoiceReverbPreset | ( | AUDIO_REVERB_PRESET | audioReverbPreset | ) |
Sets the local voice reverberation option, including the virtual stereo.
This method sets the local voice reverberation for users in a communication channel or hosts in a Live-broadcast channel. After successfully calling this method, all users in the channel can hear the voice with reverberation.
AUDIO_REVERB_FX
, ensure that you set profile in SetAudioProfile as AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)
or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)
; otherwise, this methods cannot set the corresponding voice reverberation option.AUDIO_VIRTUAL_STEREO
, Agora recommends setting the profile
parameter in SetAudioProfile
as AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)
.audioReverbPreset | The local voice reverberation option. The default value is AUDIO_REVERB_OFF , which means the original voice. See AUDIO_REVERB_PRESET. To achieve better voice effects, Agora recommends the enumeration whose name begins with AUDIO_REVERB_FX . |
int agora_gaming_rtc.IRtcEngine.SetLocalVoicePitch | ( | double | pitch | ) |
Changes the voice pitch of the local speaker.
pitch | Sets the voice pitch. The value ranges between 0.5 and 2.0. The lower the value, the lower the voice pitch. The default value is 1.0 (no change to the local voice pitch). |
int agora_gaming_rtc.IRtcEngine.SetLocalVoiceEqualization | ( | AUDIO_EQUALIZATION_BAND_FREQUENCY | bandFrequency, |
int | bandGain | ||
) |
Sets the local voice equalization effect.
bandFrequency | Sets the band frequency. The value ranges between 0 and 9, representing the respective 10-band center frequencies of the voice effects, including 31, 62, 125, 500, 1k, 2k, 4k, 8k, and 16k Hz. See AUDIO_EQUALIZATION_BAND_FREQUENCY. |
bandGain | Sets the gain of each band in dB. The value ranges between -15 and 15. |
int agora_gaming_rtc.IRtcEngine.SetLocalVoiceReverb | ( | AUDIO_REVERB_TYPE | reverbKey, |
int | value | ||
) |
Sets the local voice reverberation.
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.
reverbKey | Sets the reverberation key. See AUDIO_REVERB_TYPE. |
value | Sets the value of the reverberation key. |
int agora_gaming_rtc.IRtcEngine.SetCameraCapturerConfiguration | ( | CameraCapturerConfiguration | cameraCaptureConfiguration | ) |
Sets the camera capture configuration.
For a video call or interactive live streaming, generally the SDK controls the camera output parameters. When the default camera capturer settings do not meet special requirements or cause performance problems, we recommend using this method to set the camera capturer configuration:
cameraCaptureConfiguration | Sets the camera capturer configuration. See CameraCapturerConfiguration. |
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.
userPriority
as high for one user only.uid | The ID of the remote user. |
userPriority | Sets the priority of the remote user. See PRIORITY_TYPE. |
int agora_gaming_rtc.IRtcEngine.SetLogFileSize | ( | uint | fileSizeInKBytes | ) |
Sets the size of a log file that the SDK outputs.
logConfig
in the GetEngine method instead.By default, the SDK outputs five log files, agorasdk.log
, agorasdk_1.log
, agorasdk_2.log
, agorasdk_3.log
, agorasdk_4.log
, each with a default size of 1024 KB. These log files are encoded in UTF-8. The SDK writes the latest logs in agorasdk.log
. When agorasdk.log
is full, the SDK deletes the log file with the earliest modification time among the other four, renames agorasdk.log
to the name of the deleted log file, and create a new agorasdk.log
to record latest logs.
fileSizeInKBytes | The size (KB) of a log file. The default value is 1024 KB. If you set fileSizeInKByte to 1024 KB, the SDK outputs at most 5 MB log files; if you set it to less than 1024 KB, the maximum size of a log file is still 1024 KB. |
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.
enabled |
|
sampleRate | Sets the sample rate (Hz) of the external audio sink, which can be set as 16000, 32000, 44100 or 48000. |
channels | Sets the number of audio channels of the external audio sink:
|
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:
RegisterLocalUserAccount
method to create a user account, and then the JoinChannelWithUserAccount method to join the channel.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.
userAccount
parameter. Otherwise, this method does not take effect.userAccount
parameter is unique in the channel.appId | The App ID of your project. |
userAccount | The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
|
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:
Once the user joins the channel, the user subscribes to the audio and video streams of all the other users in the channel by default, giving rise to usage and billing calculation. If you do not want to subscribe to a specified stream or all remote streams, call the mute
methods accordingly.
token | The token generated at your server:
|
channelId | The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
|
userAccount | The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
|
int agora_gaming_rtc.IRtcEngine.JoinChannelWithUserAccount | ( | string | token, |
string | channelId, | ||
string | userAccount, | ||
ChannelMediaOptions | options | ||
) |
Joins the channel with a user account, and configures whether to publish or automatically subscribe to the audio or video streams.
After the user successfully joins the channel, the SDK triggers the following callbacks:
The remote client: OnUserJoinedHandler and OnUserInfoUpdatedHandler, if the user joining the channel is in the COMMUNICATION
profile, or is a host in the LIVE_BROADCASTING
profile.
options
parameter, which configures whether the user publishes or automatically subscribes to the audio and video streams in the channel when joining the channel. By default, the user publishes the local audio and video streams and automatically subscribes to the audio and video streams of all the other users in the channel. Subscribing incurs all associated usage costs. To unsubscribe, set the options
parameter or call the Mute
methods accordingly.token | The token generated at your server. For details, see Generate a token. |
channelId | The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
|
userAccount | The user account. The maximum length of this parameter is 255 bytes. Ensure that the user account is unique and do not set it as null. Supported character scopes are:
|
options | The channel media options: ChannelMediaOptions. |
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.
account | The user account of the user. Ensure that you set this parameter. |
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.
uid | The user ID of the remote user. Ensure that you set this parameter. |
int agora_gaming_rtc.IRtcEngine.SetBeautyEffectOptions | ( | bool | enabled, |
BeautyOptions | beautyOptions | ||
) |
Enables/Disables image enhancement and sets the options.
enabled | Sets whether or not to enable image enhancement:
|
beautyOptions | Sets the image enhancement option. See BeautyOptions. |
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.
StartScreenCaptureByDisplayId
to start sharing instead of using StartScreenCaptureByScreenRect.displayId | The 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. |
screenCaptureParameters | Sets the screen sharing encoding parameters. The screen sharing encoding parameters. The default video dimension is 1920 x 1080, that is, 2,073,600 pixels. Agora uses the value of videoDimension to calculate the charges. For details, see descriptions in ScreenCaptureParameters. |
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. 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.
screenRectangle | Sets 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. |
screenCaptureParameters | Sets the screen sharing encoding parameters. The screen sharing encoding parameters. The default video dimension is 1920 x 1080, that is, 2,073,600 pixels. Agora uses the value of videoDimension to calculate the charges. For details, see descriptions in ScreenCaptureParameters. |
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. 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.
videoContentHint | Sets the content hint for screen sharing. See VideoContentHint. |
int agora_gaming_rtc.IRtcEngine.UpdateScreenCaptureParameters | ( | ScreenCaptureParameters | screenCaptureParameters | ) |
Updates the screen sharing parameters.
screenCaptureParameters | Sets the screen sharing encoding parameters. The screen sharing encoding parameters. The default video dimension is 1920 x 1080, that is, 2,073,600 pixels. Agora uses the value of videoDimension to calculate the charges. For details, see descriptions in ScreenCaptureParameters. |
ERR_NOT_READY(-3)
: no screen or windows is being shared. int agora_gaming_rtc.IRtcEngine.UpdateScreenCaptureRegion | ( | Rectangle | rectangle | ) |
Updates the screen sharing region.
rectangle | Sets the relative location of the region to the screen or window. null means sharing the whole screen or window. See Rectangle. If the specified region overruns the screen or window, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen or window. |
ERR_NOT_READY(-3)
: no screen or windows is being shared. int agora_gaming_rtc.IRtcEngine.StopScreenCapture | ( | ) |
Stop screen sharing.
int agora_gaming_rtc.IRtcEngine.EnableLoopbackRecording | ( | bool | enabled, |
string | deviceName | ||
) |
Enables loopback capturing.
If you enable loopback capturing, the output of the sound card is mixed into the audio stream sent to the other end.
enabled | Sets whether to enable/disable loopback capturing.
|
deviceName | The device name of the sound card. The default value is null (the default sound card), which means the SDK uses the current sound card to capture. If you are using a virtual sound card, such as AgoraALD (Agora Audio Loopback Device), set this parameter as the name of the sound card ("AgoraALD"). |
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.
restriction | The operational restriction (bit mask) of the SDK on the audio session. See AUDIO_SESSION_OPERATION_RESTRICTION. |
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.
OnChannelMediaRelayStateChangedHandler
callback returns RELAY_STATE_RUNNING(2) and RELAY_OK(0), and the OnChannelMediaRelayEventHandler
callback returns RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL(4), the host starts sending data to the destination channel.OnChannelMediaRelayStateChangedHandler
callback returns RELAY_STATE_FAILURE(3), an exception occurs during the media stream relay.mediaRelayConfiguration | The configuration of the media stream relay: ChannelMediaRelayConfiguration. |
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.
StartChannelMediaRelay
method to update the destination channel.mediaRelayConfiguration | The media stream relay configuration: ChannelMediaRelayConfiguration. |
int agora_gaming_rtc.IRtcEngine.StopChannelMediaRelay | ( | ) |
Stops the media stream relay.
Once the relay stops, the host quits all the destination channels.
After a successful method call, the SDK triggers the OnChannelMediaRelayStateChangedHandler callback. If the callback returns RELAY_STATE_IDLE(0) and RELAY_OK(0), the host successfully stops the relay.
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.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.
Once the user switches to another channel, the user subscribes to the audio and video streams of all the other users in the channel by default, giving rise to usage and billing calculation. If you do not want to subscribe to a specified stream or all remote streams, call the mute
methods accordingly.
token | The token generated at your server:
|
channelId | Unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
|
int agora_gaming_rtc.IRtcEngine.SetMultiChannelWant | ( | bool | multiChannelWant | ) |
Sets whether to enable the multi-channel mode.
In multi-channel video scenarios, you must call this method to enable the multi-channel mode. Otherwise, a user cannot receive video frames from multiple channels.
multiChannelWant | Whether to enable the multi-channel mode:
|
int agora_gaming_rtc.IRtcEngine.SetMirrorApplied | ( | bool | wheatherApply | ) |
Sets whether to enable the mirror mode of both local video and remote video.
wheatherApply | Sets whether to enable the mirror mode of both local video and remote video.
|
int agora_gaming_rtc.IRtcEngine.SetInEarMonitoringVolume | ( | int | volume | ) |
Sets the volume of the in-ear monitor.
volume | Sets the volume of the in-ear monitor. The value ranges between 0 and 100 (default). |
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.
Since v3.0.0, this method supports window sharing of UWP (Universal Windows Platform) applications.
Agora tests the mainstream UWP applications by using the lastest SDK, see details as follows:
OS version | Software | Software name | Whether support |
win10 | Chrome | 76.0.3809.100 | No |
Office Word | 18.1903.1152.0 | Yes | |
Office Excel | No | ||
Office PPT | Yes | ||
WPS Word | 11.1.0.9145 | Yes | |
WPS Excel | |||
WPS PPT | |||
Media Player (come with the system) | All | Yes | |
win8 | Chrome | All | Yes |
Office Word | All | Yes | |
Office Excel | |||
Office PPT | |||
WPS Word | 11.1.0.9098 | Yes | |
WPS Excel | |||
WPS PPT | |||
Media Player(come with the system) | All | Yes | |
win7 | Chrome | 73.0.3683.103 | No |
Office Word | All | Yes | |
Office Excel | |||
Office PPT | |||
WPS Word | 11.1.0.9098 | No | |
WPS Excel | |||
WPS PPT | 11.1.0.9098 | Yes | |
Media Player(come with the system) | All | No |
windowId | The ID of the window to be shared. For information on how to get the windowId, see the advanced guide Share Screen. |
regionRect | (Optional) The relative location of the region to the window. NULL/NIL means sharing the whole window. See Rectangle. If the specified region overruns the window, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole window. |
screenCaptureParameters | The screen sharing encoding parameters. The default video dimension is 1920 x 1080, that is, 2,073,600 pixels. Agora uses the value of videoDimension to calculate the charges. For details, see descriptions in ScreenCaptureParameters. |
ERR_INVALID_ARGUMENT
: The argument is invalid. int agora_gaming_rtc.IRtcEngine.EnableInEarMonitoring | ( | bool | enabled | ) |
Enables in-ear monitoring.
enabled | Sets whether to enable/disable in-ear monitoring:
|
int agora_gaming_rtc.IRtcEngine.AdjustUserPlaybackSignalVolume | ( | uint | uid, |
int | volume | ||
) |
Adjusts the playback signal volume of a specified remote user.
You can call this method as many times as necessary to adjust the playback signal volume of different remote users, or to repeatedly adjust the playback signal volume of the same remote user.
uid | The ID of the remote user. |
volume | the playback signal volume of the specified remote user. The value ranges from 0 to 100:
|
AgoraChannel agora_gaming_rtc.IRtcEngine.CreateChannel | ( | string | channelId | ) |
Creates and gets an AgoraChannel
object.
To join more than one channel, call this method multiple times to create as many AgoraChannel
objects as needed, and call the JoinChannel method of each created AgoraChannel
object.
After joining multiple channels, you can simultaneously subscribe to streams of all the channels, but publish a stream in only one channel at one time.
channelId | The unique channel name for an Agora RTC session. It must be in the string format and not exceed 64 bytes in length. Supported character scopes are:
|
ERR_REFUSED(5)
.AgoraChannel
object, if the method call succeeds.null
, if the method call fails.ERR_REFUSED(5)
, if you set channelId as the empty string "". int agora_gaming_rtc.IRtcEngine.EnableFaceDetection | ( | bool | enable | ) |
Enables/Disables face detection for the local user.
Once face detection is enabled, the SDK triggers the OnFacePositionChangedHandler callback to report the face information of the local user, which includes the following aspects:
enable | Determines whether to enable the face detection function for the local user:
|
int agora_gaming_rtc.IRtcEngine.SetAudioMixingPitch | ( | int | pitch | ) |
Sets the pitch of the local music file.
When a local music file is mixed with a local human voice, call this method to set the pitch of the local music file only.
pitch | Sets the pitch of the local music file by chromatic scale. The default value is 0, which means keeping the original pitch. The value ranges from -12 to 12, and the pitch value between consecutive values is a chromatic value. The greater the absolute value of this parameter, the higher or lower the pitch of the local music file. |
int agora_gaming_rtc.IRtcEngine.EnableEncryption | ( | bool | enabled, |
EncryptionConfig | encryptionConfig | ||
) |
Enables/Disables the built-in encryption.
In scenarios requiring high security, Agora recommends calling this method to enable the built-in encryption before joining a channel.
All users in the same channel must use the same encryption mode and encryption key. After a user leaves the channel, the SDK automatically disables the built-in encryption. To enable the built-in encryption, call this method before the user joins the channel again.
enabled | Whether to enable the built-in encryption:
|
encryptionConfig | Configurations of built-in encryption schemas. See EncryptionConfig. |
IRtcEngine
instance before calling this method. int agora_gaming_rtc.IRtcEngine.EnableRemoteSuperResolution | ( | uint | userId, |
bool | enable | ||
) |
Enables/Disables the super-resolution algorithm for a remote user's video stream.
The algorithm effectively improves the resolution of the specified remote user's video stream. When the original resolution of the remote video stream is a × b pixels, you can receive and render the stream at a higher resolution (2a × 2b pixels) by enabling the algorithm.
After calling this method, the SDK triggers the OnUserSuperResolutionEnabledHandler callback to report whether you have successfully enabled the super-resolution algorithm.
WARN_SUPER_RESOLUTION_STREAM_OVER_LIMITATION(1610)
: The origin resolution of the remote video is beyond the range where the super-resolution algorithm can be applied.WARN_SUPER_RESOLUTION_USER_COUNT_OVER_LIMITATION(1611)
: Another user is already using the super-resolution algorithm.WARN_SUPER_RESOLUTION_DEVICE_NOT_SUPPORTED(1612)
: The device does not support the super-resolution algorithm.userId | The ID of the remote user. |
enable | Whether to enable the super-resolution algorithm:
|
int agora_gaming_rtc.IRtcEngine.EnableRemoteSuperResolution | ( | bool | enabled, |
SR_MODE | mode, | ||
uint | userId | ||
) |
Enables/Disables the super-resolution feature for a remote user's video stream. This is a beta feature.
This feature effectively boosts the resolution of a remote user's video seen by the local user. If the original resolution of a remote user's video is a × b, the local user's device can render the remote video at a resolution of 2a × 2b after you enable this feature.
After calling this method, the SDK triggers the OnUserSuperResolutionEnabledHandler callback to report whether you have successfully enabled super resolution.
libagora_super_resolution_extension.so
AgoraSuperResolutionExtension.xcframework
libagora_super_resolution_extension.dll
enabled | Determines whether to enable super resolution for the remote user's video:
|
mode | The mode of super resolution. See SR_MODE. |
userId | The user ID of the remote user. This parameter only applies when mode is set as SR_MODE_MANUAL(0) . |
-157 (ERR_MODULE_NOT_FOUND)
: The dynamic library for super resolution is not integrated. int agora_gaming_rtc.IRtcEngine.SetClientRole | ( | CLIENT_ROLE_TYPE | role, |
ClientRoleOptions | clientRoleOptions | ||
) |
Sets the role of a user in interactive live streaming.
You can call this method either before or after joining the channel to set the user role as audience or host. If you call this method to switch the user role after joining the channel, the SDK triggers the following callbacks:
LIVE_BROADCASTING
profile only (when the profile
parameter in SetChannelProfile is set as CHANNEL_PROFILE_LIVE_BROADCASTING
).role | The role of a user in interactive live streaming. See CLIENT_ROLE_TYPE. |
clientRoleOptions | The detailed options of a user, including user level. See ClientRoleOptions. |
int agora_gaming_rtc.IRtcEngine.SetVoiceBeautifierPreset | ( | VOICE_BEAUTIFIER_PRESET | preset | ) |
Sets an SDK preset voice beautifier effect.
Call this method to set an SDK preset voice beautifier effect for the local user who sends an audio stream. After setting a voice beautifier effect, all users in the channel can hear the effect.
You can set different voice beautifier effects for different scenarios. See Set the Voice Effect.
To achieve better audio effect quality, Agora recommends calling SetAudioProfile and setting the scenario
parameter to AUDIO_SCENARIO_GAME_STREAMING(3)
and the profile
parameter to AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)
or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)
before calling this method.
profile
parameter of SetAudioProfile
to AUDIO_PROFILE_SPEECH_STANDARD(1)
or AUDIO_PROFILE_IOT(6)
; otherwise, this method call does not take effect.SetVoiceBeautifierPreset
:
preset | The options for SDK preset voice beautifier effects: VOICE_BEAUTIFIER_PRESET. |
int agora_gaming_rtc.IRtcEngine.SetAudioEffectPreset | ( | AUDIO_EFFECT_PRESET | preset | ) |
Sets an SDK preset audio effect.
Call this method to set an SDK preset audio effect for the local user who sends an audio stream. This audio effect does not change the gender characteristics of the original voice. After setting an audio effect, all users in the channel can hear the effect.
You can set different audio effects for different scenarios. See Set the Voice Effect.
To achieve better audio effect quality, Agora recommends calling SetAudioProfile and setting the scenario
parameter to AUDIO_SCENARIO_GAME_STREAMING(3)
before calling this method.
parameter
of setAudioProfile
to AUDIO_PROFILE_SPEECH_STANDARD(1)
or AUDIO_PROFILE_IOT(6)
; otherwise, this method call does not take effect.preset
parameter to enumerators except ROOM_ACOUSTICS_3D_VOICE
or PITCH_CORRECTION
, do not call SetAudioEffectParameters; otherwise, setAudioEffectParameters
overrides this method.SetAudioEffectPreset
:
preset | The options for SDK preset audio effects. See AUDIO_EFFECT_PRESET. |
int agora_gaming_rtc.IRtcEngine.SetAudioEffectParameters | ( | AUDIO_EFFECT_PRESET | preset, |
int | param1, | ||
int | param2 | ||
) |
Sets parameters for SDK preset audio effects.
Call this method to set the following parameters for the local user who send an audio stream:
After setting parameters, all users in the channel can hear the relevant effect.
You can call this method directly or after SetAudioEffectPreset. If you call this method after SetAudioEffectPreset
, ensure that you set the preset parameter of SetAudioEffectPreset
to ROOM_ACOUSTICS_3D_VOICE
or PITCH_CORRECTION
and then call this method to set the same enumerator; otherwise, this method overrides SetAudioEffectPreset
.
scenario
parameter to AUDIO_SCENARIO_GAME_STREAMING(3)
before calling this method.profile
parameter of SetAudioProfile
to AUDIO_PROFILE_SPEECH_STANDARD(1)
or AUDIO_PROFILE_IOT(6)
; otherwise, this method call does not take effect.setAudioEffectParameters
:
preset | The options for SDK preset audio effects:
|
param1 |
|
param2 |
|
int agora_gaming_rtc.IRtcEngine.SendCustomReportMessage | ( | string | id, |
string | category, | ||
string | events, | ||
string | label, | ||
int | value | ||
) |
Agora supports reporting and analyzing customized messages.
This function is in the beta stage with a free trial. The ability provided in its beta test version is reporting a maximum of 10 message pieces within 6 seconds, with each message piece not exceeding 256 bytes and each string not exceeding 100 bytes. To try out this function, contact support@agora.io and discuss the format of customized messages with us.
int agora_gaming_rtc.IRtcEngine.SetVoiceBeautifierParameters | ( | VOICE_BEAUTIFIER_PRESET | preset, |
int | param1, | ||
int | param2 | ||
) |
Sets parameters for SDK preset voice beautifier effects.
Call this method to set a gender characteristic and a reverberation effect for the singing beautifier effect. This method sets parameters for the local user who sends an audio stream. See Set the Voice Effect.
After you call this method successfully, all users in the channel can hear the relevant effect.
To achieve better audio effect quality, before you call this method, Agora recommends calling SetAudioProfile, and setting the scenario
parameter as AUDIO_SCENARIO_GAME_STREAMING(3)
and the profile
parameter as AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)
or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)
.
profile
parameter of SetAudioProfile
as AUDIO_PROFILE_SPEECH_STANDARD(1)
or AUDIO_PROFILE_IOT(6)
; otherwise, this method call does not take effect.SetVoiceBeautifierParameters
:
preset | The options for SDK preset voice beautifier effects:
|
param1 | The gender characteristics options for the singing voice:
|
param2 | The reverberation effects options:
|
int agora_gaming_rtc.IRtcEngine.EnableDeepLearningDenoise | ( | bool | enable | ) |
Enables or disables deep-learning noise reduction.
The SDK enables traditional noise reduction mode by default to reduce most of the stationary background noise. If you need to reduce most of the non-stationary background noise, Agora recommends enabling deep-learning noise reduction as follows:
libagora_ai_denoise_extension.so
AgoraAIDenoiseExtension.framework
AgoraAIDenoiseExtension.framework
libagora_ai_denoise_extension.dll
EnableDeepLearningDenoise(true)
.Deep-learning noise reduction requires high-performance devices. For example, the following devices and later models are known to support deep-learning noise reduction:
After successfully enabling deep-learning noise reduction, if the SDK detects that the device performance is not sufficient, it automatically disables deep-learning noise reduction and enables traditional noise reduction.
If you call EnableDeepLearningDenoise(false)
or the SDK automatically disables deep-learning noise reduction in the channel, when you need to re-enable deep-learning noise reduction, you need to call LeaveChannel first, and then call EnableDeepLearningDenoise(true)
.
enable | Sets whether to enable deep-learning noise reduction.
|
-157
(ERR_MODULE_NOT_FOUND
): The dynamical library for enabling deep-learning noise reduction is not integrated. int agora_gaming_rtc.IRtcEngine.JoinChannel | ( | string | token, |
string | channelId, | ||
string | info, | ||
uint | uid, | ||
ChannelMediaOptions | options | ||
) |
Joins a channel with the user ID, and configures whether to publish or automatically subscribe to the audio or video streams.
Users in the same channel can talk to each other, and multiple users in the same channel can start a group chat. Users with different App IDs cannot call each other.
You must call the LeaveChannel method to exit the current call before entering another channel.
A successful JoinChannel
method call triggers the following callbacks:
COMMUNICATION
profile, or is a host in the LIVE_BROADCASTING
profile.When the connection between the client and the Agora server is interrupted due to poor network conditions, the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the OnReJoinChannelSuccessHandler callback on the local client.
JoinChannel
method in the IRtcEngine class, this method has the options
parameter, which configures whether the user publishes or automatically subscribes to the audio and video streams in the channel when joining the channel. By default, the user publishes the local audio and video streams and automatically subscribes to the audio and video streams of all the other users in the channel. Subscribing incurs all associated usage costs. To unsubscribe, set the options parameter
or call the Mute
methods accordingly.IRtcEngine
object.token | The token generated at your server. See Authenticate Your Users with Tokens. |
channelId | The unique channel name for an Agora RTC session. It must be in the string format and not exceed 64 bytes in length. Supported character scopes are:
|
info | (Optional) Reserved for future use. |
uid | The 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 , because the SDK does not do so.
|
options | The channel media options: ChannelMediaOptions. |
AgoraChannel
object with the same channel name.AgoraChannel
object. When you join a channel created by the IRtcEngine
object, the SDK publishes the local audio and video streams to that channel by default. Because the SDK does not support publishing a local stream to more than one channel simultaneously, an error occurs in this occasion.int agora_gaming_rtc.IRtcEngine.SwitchChannel | ( | string | token, |
string | channelId, | ||
ChannelMediaOptions | options | ||
) |
Switches to a different channel, and configures whether to automatically subscribe to audio or video streams in the target channel.
This method allows the audience of a LIVE_BROADCASTING
channel to switch to a different channel.
After the user successfully switches to another channel, the OnLeaveChannelHandler and OnJoinChannelSuccessHandler callbacks are triggered to indicate that the user has left the original channel and joined a new one.
LIVE_BROADCASTING
channel only.options
parameter or call the mute
methods accordingly.token | The token generated at your server. For details, see Generate a token. |
channelId | Unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
|
options | The channel media options: ChannelMediaOptions. |
int agora_gaming_rtc.IRtcEngine.SetVoiceConversionPreset | ( | VOICE_CONVERSION_PRESET | preset | ) |
Sets an SDK preset voice conversion effect.
Call this method to set an SDK preset voice conversion effect for the local user who sends an audio stream. After setting a voice conversion effect, all users in the channel can hear the effect.
You can set different voice conversion effects for different scenarios. See Set the Voice Effect.
To achieve better voice effect quality, Agora recommends calling SetAudioProfile and setting the profile
parameter to AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)
or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)
and the scenario
parameter to AUDIO_SCENARIO_GAME_STREAMING(3)
before calling this method.
profile
parameter of SetAudioProfile
to AUDIO_PROFILE_SPEECH_STANDARD(1)
or AUDIO_PROFILE_IOT(6)
; otherwise, this method call does not take effect.SetVoiceConversionPreset
:
preset | The options for SDK preset voice conversion effects: VOICE_CONVERSION_PRESET. |
int agora_gaming_rtc.IRtcEngine.SetCloudProxy | ( | CLOUD_PROXY_TYPE | proxyType | ) |
Sets the Agora cloud proxy service.
When the user's firewall restricts the IP address and port, refer to Use Cloud Proxy to add the specific IP addresses and ports to the firewall whitelist; then, call this method to enable the cloud proxy and set the proxyType
parameter as UDP_PROXY(1)
, which is the cloud proxy for the UDP protocol.
After a successfully cloud proxy connection, the SDK triggers the OnConnectionStateChangedHandler(CONNECTION_STATE_CONNECTING, CONNECTION_CHANGED_SETTING_PROXY_SERVER)
callback.
To disable the cloud proxy that has been set, call SetCloudProxy(NONE_PROXY)
. To change the cloud proxy type that has been set, call SetCloudProxy(NONE_PROXY)
first, and then call SetCloudProxy
, and pass the value that you expect in proxyType
.
proxyType | The cloud proxy type, see CLOUD_PROXY_TYPE. This parameter is required, and the SDK reports an error if you do not pass in a value. |
-2(ERR_INVALID_ARGUMENT)
: The parameter is invalid.-7(ERR_NOT_INITIALIZED)
: The SDK is not initialized. int agora_gaming_rtc.IRtcEngine.AdjustLoopbackRecordingSignalVolume | ( | int | volume | ) |
Adjusts the volume of the signal captured by the sound card.
After calling EnableLoopbackRecording
to enable loopback audio capturing, you can call this method to adjust the volume of the signal captured by the sound card.
volume | The volume of the signal captured by the sound card. The value ranges between 0 and 100, where 0 represents no volume and 100 the original volume. |
int agora_gaming_rtc.IRtcEngine.StartAudioRecording | ( | AudioRecordingConfiguration | config | ) |
Starts an audio recording on the client.
The SDK allows recording audio during a call. After successfully calling this method, you can record the audio of users in the channel and get an audio recording file. Supported file formats are as follows:
AUDIO_RECORDING_QUALITY_MEDIUM
, the file size for a 10-minute recording is approximately 2 MB.Once the user leaves the channel, the recording automatically stops.
config | The recording configuration. See AudioRecordingConfiguration |
stopRecording
to stop the current recording and then call this method again. int agora_gaming_rtc.IRtcEngine.SetLocalAccessPoint | ( | LocalAccessPointConfiguration | config | ) |
int agora_gaming_rtc.IRtcEngine.EnableVirtualBackground | ( | bool | enabled, |
VirtualBackgroundSource | source | ||
) |
Enables/Disables the virtual background.
After enabling the virtual background feature, you can replace the original background image of the local user with a custom background image. After the replacement, all users in the channel can see the custom background image. You can find out from the OnVirtualBackgroundSourceEnabledHandler callback whether the virtual background is successfully enabled or the cause of any errors.
EnableVideo
.enabled | Sets whether to enable the virtual background:
|
source | The custom background image. See VirtualBackgroundSource. Note: To adapt the resolution of the custom background image to the resolution of the SDK capturing video, the SDK scales and crops the custom background image while ensuring that the content of the custom background image is not distorted. |
int agora_gaming_rtc.IRtcEngine.SetCameraTorchOn | ( | bool | on | ) |
Sets whether to enable the flash.
true
, you might fail to successfully enable the flash by calling SetCameraTorchOn
due to system issues.on | Determines whether to enable the flash:
|
bool agora_gaming_rtc.IRtcEngine.IsCameraTorchSupported | ( | ) |
Checks whether the device supports enabling the flash.
The SDK uses the front camera by default, so if you call IsCameraTorchSupported
directly, you can find out from the return value whether the device supports enabling the flash when using the front camera. If you want to check whether the device supports enabling the flash when using the rear camera, call SwitchCamera to switch the camera used by the SDK to the rear camera, and then call IsCameraTorchSupported
.
IsCameraTorchSupported
returns true, you might fail to enable the flash by calling SetCameraTorchOn due to system issues.int agora_gaming_rtc.IRtcEngine.SetExternalAudioSourceVolume | ( | int | sourcePos, |
int | volume | ||
) |
Sets the volume of the external audio frame in the specified position.
You can call this method multiple times to set the volume of external audio frames in different positions. The volume setting takes effect for all external audio frames that are pushed to the specified position.
sourcePos | The push position of the external audio frame. |
volume | The volume of the external audio frame. The value range is [0,100]. The default value is 100, which represents the original value. |
-2(ERR_INALID_ARGUMENT)
: The parameter is invalid. int agora_gaming_rtc.IRtcEngine.SetAudioMixingPlaybackSpeed | ( | int | speed | ) |
Sets the playback speed of the current music file.
StartAudioMixing
and receiving the OnAudioMixingStateChangedHandler(AUDIO_MIXING_STATE_PLAYING)
callback.speed | The playback speed. Agora recommends that you limit this value to between 50 and 400, defined as follows:
|
int agora_gaming_rtc.IRtcEngine.SelectAudioTrack | ( | int | index | ) |
Specifies the playback track of the current music file.
After getting the audio track index of the current music file, call this method to specify any audio track to play. For example, if different tracks of a multitrack file store songs in different languages, you can call this method to set the language of the music file to play.
StartAudioMixing
and receiving the OnAudioMixingStateChangedHandler(AUDIO_MIXING_STATE_PLAYING)
callback.index | The specified playback track. This parameter must be less than or equal to the return value of GetAudioTrackCount. |
int agora_gaming_rtc.IRtcEngine.GetAudioTrackCount | ( | ) |
Gets the audio track index of the current music file.
StartAudioMixing
and receiving the OnAudioMixingStateChangedHandler(AUDIO_MIXING_STATE_PLAYING)
callback.@ param The specified playback track. This parameter must be less than or equal to the return value of GetAudioTrackCount.
int agora_gaming_rtc.IRtcEngine.SetAudioMixingDualMonoMode | ( | AUDIO_MIXING_DUAL_MONO_MODE | mode | ) |
Sets the channel mode of the current music file.
In a stereo music file, the left and right channels can store different audio data. According to your needs, you can set the channel mode to original mode, left channel mode, right channel mode, or mixed channel mode. For example, in the KTV scenario, the left channel of the music file stores the musical accompaniment, and the right channel stores the singing voice. If you only need to listen to the accompaniment, call this method to set the channel mode of the music file to left channel mode; if you need to listen to the accompaniment and the singing voice at the same time, call this method to set the channel mode to mixed channel mode.
StartAudioMixing
and receiving the OnAudioMixingStateChangedHandler(AUDIO_MIXING_STATE_PLAYING)
callback.mode | The channel mode, see AUDIO_MIXING_DUAL_MONO_MODE. |
int agora_gaming_rtc.IRtcEngine.PauseAllChannelMediaRelay | ( | ) |
Pauses the media stream relay to all destination channels.
After the cross-channel media stream relay starts, you can call this method to pause relaying media streams to all destination channels; after the pause, if you want to resume the relay, call ResumeAllChannelMediaRelay.
After a successful method call, the SDK triggers the OnChannelMediaRelayEventHandler callback to report whether the media stream relay is successfully paused.
int agora_gaming_rtc.IRtcEngine.ResumeAllChannelMediaRelay | ( | ) |
Resumes the media stream relay to all destination channels.
After calling the PauseAllChannelMediaRelay method, you can call this method to resume relaying media streams to all destination channels.
After a successful method call, the SDK triggers the OnChannelMediaRelayEventHandler callback to report whether the media stream relay is successfully resumed.
int agora_gaming_rtc.IRtcEngine.GetAudioFileInfo | ( | string | filePath | ) |
Gets the information of a specified audio file.
After calling this method successfully, the SDK triggers the OnRequestAudioFileInfoHandler callback to report the information of an audio file, such as audio duration. You can call this method multiple times to get the information of multiple audio files.
filePath | The file path:
|
int agora_gaming_rtc.IRtcEngine.TakeSnapshot | ( | string | channel, |
uint | uid, | ||
string | filePath | ||
) |
Takes a snapshot of a video stream.
This method takes a snapshot of a video stream from the specified user, generates a JPG image, and saves it to the specified path.
The method is asynchronous, and the SDK has not taken the snapshot when the method call returns. After a successful method call, the SDK triggers the OnSnapshotTakenHandler callback to report whether the snapshot is successfully taken as well as the details of the snapshot taken.
channel | The channel name. |
uid | The user ID of the user. Set uid as 0 if you want to take a snapshot of the local user's video. |
filePath | The local path (including the filename extensions) of the snapshot. For example, C:\Users\<user_name>\AppData\Local\Agora\<process_name>\example.jpg on Windows, /App Sandbox/Library/Caches/example.jpg on iOS, ~/Library/Logs/example.jpg on macOS, and /storage/emulated/0/Android/data/<package name>/files/example.jpg on Android. Ensure that the path you specify exists and is writable. |
int agora_gaming_rtc.IRtcEngine.SetLowlightEnhanceOptions | ( | bool | enabled, |
LowLightEnhanceOptions | options | ||
) |
Sets low-light enhancement.
The low-light enhancement feature can adaptively adjust the brightness value of the video captured in situations with low or uneven lighting, such as backlit, cloudy, or dark scenes. It restores or highlights the image details and improves the overall visual effect of the video.
You can call this method to enable the low-light enhancement feature and set the options of the low-light enhancement effect.
EnableVideo
.enabled | Whether to enable low-light enhancement:
|
options | The low-light enhancement options. See LowLightEnhanceOptions. |
int agora_gaming_rtc.IRtcEngine.SetVideoDenoiserOptions | ( | bool | enabled, |
VideoDenoiserOptions | options | ||
) |
Sets video noise reduction.
Underlit environments and low-end video capture devices can cause video images to contain significant noise, which affects video quality. In real-time interactive scenarios, video noise also consumes bitstream resources and reduces encoding efficiency during encoding.
You can call this method to enable the video noise reduction feature and set the options of the video noise reduction effect.
EnableVideo
.enabled | Whether to enable video noise reduction:
|
options | The video reduction options. See VideoDenoiserOptions. |
int agora_gaming_rtc.IRtcEngine.SetColorEnhanceOptions | ( | bool | enabled, |
ColorEnhanceOptions | options | ||
) |
Sets color enhancement.
You can call this method to enable the color enhancement feature and set the options of the color enhancement effect.
EnableVideo
.enabled | Whether to enable color enhancement:
|
options | The color enhancement options. See ColorEnhanceOptions. |
int agora_gaming_rtc.IRtcEngine.EnableContentInspect | ( | bool | enabled, |
string | extraInfo, | ||
ContentInspectModule[] | modules, | ||
int | moduleCount | ||
) |
int agora_gaming_rtc.IRtcEngine.SetAVSyncSource | ( | string | channelId, |
uint | uid | ||
) |
Bind local user and a remote user as an audio&video sync group. The remote user is defined by cid and uid. There’s a usage limit that local user must be a video stream sender. On the receiver side, media streams from same sync group will be time-synced
channelId | The channel id |
uid | The user ID of the remote user to be bound with (local user) |
int agora_gaming_rtc.IRtcEngine.StartRtmpStreamWithoutTranscoding | ( | string | url | ) |
Starts pushing media streams to a CDN without transcoding.
You can call this method to push a live audio-and-video stream to the specified CDN address. This method can push media streams to only one CDN address at a time, so if you need to push streams to multiple addresses, call this method multiple times.
After you call this method, the SDK triggers the OnRtmpStreamingStateChangedHandler callback on the local client to report the state of the streaming.
LIVE_BROADCASTING profile
can call this method.url | The address of the CDN live streaming. The format is RTMP. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported. |
ERR_INVALID_ARGUMENT (2)
: The RTMP URL address is NULL or the string length is 0.ERR_NOT_INITIALIZED (7)
: The SDK is not initialized before calling this method. int agora_gaming_rtc.IRtcEngine.StartRtmpStreamWithTranscoding | ( | string | url, |
LiveTranscoding | transcoding | ||
) |
Starts pushing media streams to a CDN and sets the transcoding configuration.
You can call this method to push a live audio-and-video stream to the specified CDN address and set the transcoding configuration. This method can push media streams to only one CDN address at a time, so if you need to push streams to multiple addresses, call this method multiple times.
After you call this method, the SDK triggers the OnRtmpStreamingStateChangedHandler callback on the local client to report the state of the streaming.
LIVE_BROADCASTING profile
can call this method.url | The address of the CDN live streaming. The format is RTMP or RTMPS. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported. |
transcoding | The transcoding configuration for CDN live streaming. See LiveTranscoding. |
int agora_gaming_rtc.IRtcEngine.UpdateRtmpTranscoding | ( | LiveTranscoding | transcoding | ) |
Updates the transcoding configuration.
After you start pushing media streams to CDN with transcoding, you can dynamically update the transcoding configuration according to the scenario. The SDK triggers the OnTranscodingUpdatedHandler callback after the transcoding configuration is updated.
transcoding | The transcoding configuration for CDN live streaming. See LiveTranscoding. |
int agora_gaming_rtc.IRtcEngine.StopRtmpStream | ( | string | url | ) |
Stops pushing media streams to a CDN.
You can call this method to stop the live stream on the specified CDN address. This method can stop pushing media streams to only one CDN address at a time, so if you need to stop pushing streams to multiple addresses, call this method multiple times.
After you call this method, the SDK triggers the OnRtmpStreamingStateChangedHandler callback on the local client to report the state of the streaming.
url | The address of the CDN live streaming. The format is RTMP or RTMPS. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported. |
int agora_gaming_rtc.IRtcEngine.EnableWirelessAccelerate | ( | bool | enabled | ) |
int agora_gaming_rtc.IRtcEngine.EnableLocalVoicePitchCallback | ( | int | interval | ) |
Enables reporting the voice pitch of the local user.
This method enables the SDK to regularly report the pitch value of the local user who sends a stream. After the local audio capture is enabled, and you call this method, the SDK triggers the OnLocalVoicePitchInHzHandler callback at the time interval set in this method.
interval | Sets the time interval at which the SDK triggers the OnLocalVoicePitchInHzHandler callback:
|
int agora_gaming_rtc.IRtcEngine.SetScreenCaptureScenario | ( | int | screenScenario | ) |
Sets the screen sharing scenario.
When you start screen sharing or window sharing, you can call this method to set the screen sharing scenario. The SDK adjusts the video quality and experience of the sharing according to the scenario.
screenScenario | The screen sharing scenario. See SCREEN_SCENARIO_TYPE. |
int agora_gaming_rtc.IRtcEngine.SetCameraZoomFactor | ( | float | factor | ) |
Sets the camera zoom ratio.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
factor | Sets the camera zoom factor. The value ranges between 1.0 and the maximum zoom supported by the device. |
float agora_gaming_rtc.IRtcEngine.GetCameraMaxZoomFactor | ( | ) |
Gets the maximum zoom ratio supported by the camera.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
bool agora_gaming_rtc.IRtcEngine.IsCameraZoomSupported | ( | ) |
Checks whether the camera zoom function is supported.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
bool agora_gaming_rtc.IRtcEngine.IsCameraFocusSupported | ( | ) |
Checks whether the camera manual focus function is supported.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
true
: The device supports the camera manual focus function.false
: The device does not support the camera manual focus function. bool agora_gaming_rtc.IRtcEngine.IsCameraExposurePositionSupported | ( | ) |
Checks whether the camera exposure function is supported.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
true
: The device supports the camera exposure function.false
: The device does not support the camera exposure function. bool agora_gaming_rtc.IRtcEngine.IsCameraAutoFocusFaceModeSupported | ( | ) |
Checks whether the camera auto-face focus function is supported.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
true
: The device supports the camera auto-face focus function.false
: The device does not support the camera auto-face focus function. int agora_gaming_rtc.IRtcEngine.SetCameraFocusPositionInPreview | ( | float | positionX, |
float | positionY | ||
) |
Sets the camera manual focus position.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
A successful setCameraFocusPositionInPreview method call triggers the OnCameraFocusAreaChangedHandler callback on the local client.
positionX | The horizontal coordinate of the touch point in the view. |
positionY | The vertical coordinate of the touch point in the view. |
int agora_gaming_rtc.IRtcEngine.SetCameraExposurePosition | ( | float | positionXinView, |
float | positionYinView | ||
) |
Sets the camera exposure position.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
positionXinView | The horizontal coordinate of the touch point in the view. |
positionYinView | The vertical coordinate of the touch point in the view. |
int agora_gaming_rtc.IRtcEngine.SetCameraAutoFocusFaceModeEnabled | ( | bool | enabled | ) |
Sets whether to enable face auto-focus.
The SDK disables face autofocus by default. To set face autofocus, call this method.
enabled | Whether to enable face auto-focus:
|
|
static |
Initializes an IRtcEngine instance.
Unless otherwise specified, all the methods provided by the IRtcEngine class are executed asynchronously. Agora recommends calling these methods in the same thread.
GetEngine2
and this method is that GetEngine2
enables you to specify the connection area.appId | The App ID issued to you by Agora. See How to get the App ID. Only users in apps with the same App ID can join the same channel and communicate with each other. Use an App ID to initialize only one IRtcEngine instance. To change your App ID, call Destroy to destroy the current IRtcEngine instance and then call this method to initialize an IRtcEngine instance with the new App ID. |
ERR_FAILED
): A general error occurs (no specified reason).ERR_INVALID_ARGUMENT
): No IRtcEngineEventHandler object is specified.ERR_NOT_INITIALIZED
): The SDK is not initialized. Check whether context is properly set.ERR_RESOURCE_LIMITED
): The resource is limited. The app uses too much of the system resource and fails to allocate any resources.ERR_INVALID_APP_ID
): The App ID is invalid.
|
static |
Initializes an IRtcEngine instance.
Unless otherwise specified, all the methods provided by the IRtcEngine class are executed asynchronously. Agora recommends calling these methods in the same thread.
GetEngine1
and this method is that this method enables you to specify the connection area.engineConfig | Configurations for the IRtcEngine instance. For details, see RtcEngineConfig. |
ERR_FAILED
): A general error occurs (no specified reason).ERR_INVALID_ARGUMENT
): No IRtcEngineEventHandler object is specified.ERR_NOT_INITIALIZED
): The SDK is not initialized. Check whether context is properly set.ERR_RESOURCE_LIMITED
): The resource is limited. The app uses too much of the system resource and fails to allocate any resources.ERR_INVALID_APP_ID
): The App ID is invalid.
|
static |
Initializes the IRtcEngine.
appId | The App ID of your project. |
|
static |
Destroys the IRtcEngine
instance and releases all resources used by the Agora RTC SDK.
Use this method for apps in which users occasionally make voice or video calls. When users do not make calls, you can free up resources for other operations. Once you call Destroy
to destroy the created IRtcEngine
instance, you cannot use any method or callback in the SDK any more. If you want to use the real-time communication functions again, you must call GetEngine to Initialize a new IRtcEngine
instance.
Destroy
is a synchronous method and the app cannot move on to another task until the execution completes, Agora suggests calling this method in a sub-thread to avoid congestion in the main thread. Besides, you cannot call Destroy
in any method or callback of the SDK. Otherwise, the SDK cannot release the resources occupied by the IRtcEngine
instance until the callbacks return results, which may result in a deadlock.IRtcEngine
instance after destroying the current one, ensure that you wait till the destroy
method completes executing.
|
static |
Query the IRtcEngine instance.
OnJoinChannelSuccessHandler agora_gaming_rtc.IRtcEngine.OnJoinChannelSuccess |
OnReJoinChannelSuccessHandler agora_gaming_rtc.IRtcEngine.OnReJoinChannelSuccess |
OnConnectionLostHandler agora_gaming_rtc.IRtcEngine.OnConnectionLost |
OnConnectionInterruptedHandler agora_gaming_rtc.IRtcEngine.OnConnectionInterrupted |
OnRequestTokenHandler agora_gaming_rtc.IRtcEngine.OnRequestToken |
OnUserJoinedHandler agora_gaming_rtc.IRtcEngine.OnUserJoined |
OnUserOfflineHandler agora_gaming_rtc.IRtcEngine.OnUserOffline |
OnLeaveChannelHandler agora_gaming_rtc.IRtcEngine.OnLeaveChannel |
OnVolumeIndicationHandler agora_gaming_rtc.IRtcEngine.OnVolumeIndication |
OnLocalVoicePitchInHzHandler agora_gaming_rtc.IRtcEngine.OnLocalVoicePitchInHz |
OnUserMutedAudioHandler agora_gaming_rtc.IRtcEngine.OnUserMutedAudio |
OnSDKWarningHandler agora_gaming_rtc.IRtcEngine.OnWarning |
OnSDKErrorHandler agora_gaming_rtc.IRtcEngine.OnError |
OnRtcStatsHandler agora_gaming_rtc.IRtcEngine.OnRtcStats |
OnAudioMixingFinishedHandler agora_gaming_rtc.IRtcEngine.OnAudioMixingFinished |
OnAudioRouteChangedHandler agora_gaming_rtc.IRtcEngine.OnAudioRouteChanged |
OnFirstRemoteVideoDecodedHandler agora_gaming_rtc.IRtcEngine.OnFirstRemoteVideoDecoded |
OnVideoSizeChangedHandler agora_gaming_rtc.IRtcEngine.OnVideoSizeChanged |
OnClientRoleChangedHandler agora_gaming_rtc.IRtcEngine.OnClientRoleChanged |
OnUserMuteVideoHandler agora_gaming_rtc.IRtcEngine.OnUserMuteVideo |
OnMicrophoneEnabledHandler agora_gaming_rtc.IRtcEngine.OnMicrophoneEnabled |
OnFirstRemoteAudioFrameHandler agora_gaming_rtc.IRtcEngine.OnFirstRemoteAudioFrame |
OnFirstLocalAudioFrameHandler agora_gaming_rtc.IRtcEngine.OnFirstLocalAudioFrame |
OnApiExecutedHandler agora_gaming_rtc.IRtcEngine.OnApiExecuted |
OnLastmileQualityHandler agora_gaming_rtc.IRtcEngine.OnLastmileQuality |
OnAudioQualityHandler agora_gaming_rtc.IRtcEngine.OnAudioQuality |
OnStreamInjectedStatusHandler agora_gaming_rtc.IRtcEngine.OnStreamInjectedStatus |
OnStreamUnpublishedHandler agora_gaming_rtc.IRtcEngine.OnStreamUnpublished |
OnStreamPublishedHandler agora_gaming_rtc.IRtcEngine.OnStreamPublished |
OnStreamMessageErrorHandler agora_gaming_rtc.IRtcEngine.OnStreamMessageError |
OnStreamMessageHandler agora_gaming_rtc.IRtcEngine.OnStreamMessage |
OnConnectionBannedHandler agora_gaming_rtc.IRtcEngine.OnConnectionBanned |
OnConnectionStateChangedHandler agora_gaming_rtc.IRtcEngine.OnConnectionStateChanged |
OnTokenPrivilegeWillExpireHandler agora_gaming_rtc.IRtcEngine.OnTokenPrivilegeWillExpire |
OnActiveSpeakerHandler agora_gaming_rtc.IRtcEngine.OnActiveSpeaker |
OnVideoStoppedHandler agora_gaming_rtc.IRtcEngine.OnVideoStopped |
OnFirstLocalVideoFrameHandler agora_gaming_rtc.IRtcEngine.OnFirstLocalVideoFrame |
OnFirstRemoteVideoFrameHandler agora_gaming_rtc.IRtcEngine.OnFirstRemoteVideoFrame |
OnUserEnableVideoHandler agora_gaming_rtc.IRtcEngine.OnUserEnableVideo |
OnUserEnableLocalVideoHandler agora_gaming_rtc.IRtcEngine.OnUserEnableLocalVideo |
OnRemoteVideoStateChangedHandler agora_gaming_rtc.IRtcEngine.OnRemoteVideoStateChanged |
OnLocalPublishFallbackToAudioOnlyHandler agora_gaming_rtc.IRtcEngine.OnLocalPublishFallbackToAudioOnly |
OnRemoteSubscribeFallbackToAudioOnlyHandler agora_gaming_rtc.IRtcEngine.OnRemoteSubscribeFallbackToAudioOnly |
OnNetworkQualityHandler agora_gaming_rtc.IRtcEngine.OnNetworkQuality |
OnLocalVideoStatsHandler agora_gaming_rtc.IRtcEngine.OnLocalVideoStats |
OnRemoteVideoStatsHandler agora_gaming_rtc.IRtcEngine.OnRemoteVideoStats |
OnRemoteAudioStatsHandler agora_gaming_rtc.IRtcEngine.OnRemoteAudioStats |
OnAudioDeviceStateChangedHandler agora_gaming_rtc.IRtcEngine.OnAudioDeviceStateChanged |
OnCameraReadyHandler agora_gaming_rtc.IRtcEngine.OnCameraReady |
OnCameraFocusAreaChangedHandler agora_gaming_rtc.IRtcEngine.OnCameraFocusAreaChanged |
OnCameraExposureAreaChangedHandler agora_gaming_rtc.IRtcEngine.OnCameraExposureAreaChanged |
OnRemoteAudioMixingBeginHandler agora_gaming_rtc.IRtcEngine.OnRemoteAudioMixingBegin |
OnRemoteAudioMixingEndHandler agora_gaming_rtc.IRtcEngine.OnRemoteAudioMixingEnd |
OnAudioEffectFinishedHandler agora_gaming_rtc.IRtcEngine.OnAudioEffectFinished |
OnVideoDeviceStateChangedHandler agora_gaming_rtc.IRtcEngine.OnVideoDeviceStateChanged |
OnRemoteVideoTransportStatsHandler agora_gaming_rtc.IRtcEngine.OnRemoteVideoTransportStats |
OnRemoteAudioTransportStatsHandler agora_gaming_rtc.IRtcEngine.OnRemoteAudioTransportStats |
OnTranscodingUpdatedHandler agora_gaming_rtc.IRtcEngine.OnTranscodingUpdated |
OnAudioDeviceVolumeChangedHandler agora_gaming_rtc.IRtcEngine.OnAudioDeviceVolumeChanged |
OnMediaEngineStartCallSuccessHandler agora_gaming_rtc.IRtcEngine.OnMediaEngineStartCallSuccess |
OnMediaEngineLoadSuccessHandler agora_gaming_rtc.IRtcEngine.OnMediaEngineLoadSuccess |
OnAudioMixingStateChangedHandler agora_gaming_rtc.IRtcEngine.OnAudioMixingStateChanged |
OnFirstRemoteAudioDecodedHandler agora_gaming_rtc.IRtcEngine.OnFirstRemoteAudioDecoded |
OnLocalVideoStateChangedHandler agora_gaming_rtc.IRtcEngine.OnLocalVideoStateChanged |
OnRtmpStreamingStateChangedHandler agora_gaming_rtc.IRtcEngine.OnRtmpStreamingStateChanged |
OnNetworkTypeChangedHandler agora_gaming_rtc.IRtcEngine.OnNetworkTypeChanged |
OnLastmileProbeResultHandler agora_gaming_rtc.IRtcEngine.OnLastmileProbeResult |
OnLocalUserRegisteredHandler agora_gaming_rtc.IRtcEngine.OnLocalUserRegistered |
OnUserInfoUpdatedHandler agora_gaming_rtc.IRtcEngine.OnUserInfoUpdated |
OnLocalAudioStateChangedHandler agora_gaming_rtc.IRtcEngine.OnLocalAudioStateChanged |
OnRemoteAudioStateChangedHandler agora_gaming_rtc.IRtcEngine.OnRemoteAudioStateChanged |
OnLocalAudioStatsHandler agora_gaming_rtc.IRtcEngine.OnLocalAudioStats |
OnChannelMediaRelayEventHandler agora_gaming_rtc.IRtcEngine.OnChannelMediaRelayEvent |
OnChannelMediaRelayStateChangedHandler agora_gaming_rtc.IRtcEngine.OnChannelMediaRelayStateChanged |
OnFacePositionChangedHandler agora_gaming_rtc.IRtcEngine.OnFacePositionChanged |
OnRtmpStreamingEventHandler agora_gaming_rtc.IRtcEngine.OnRtmpStreamingEvent |
OnAudioPublishStateChangedHandler agora_gaming_rtc.IRtcEngine.OnAudioPublishStateChanged |
OnVideoPublishStateChangedHandler agora_gaming_rtc.IRtcEngine.OnVideoPublishStateChanged |
OnAudioSubscribeStateChangedHandler agora_gaming_rtc.IRtcEngine.OnAudioSubscribeStateChanged |
OnVideoSubscribeStateChangedHandler agora_gaming_rtc.IRtcEngine.OnVideoSubscribeStateChanged |
OnFirstLocalAudioFramePublishedHandler agora_gaming_rtc.IRtcEngine.OnFirstLocalAudioFramePublished |
OnFirstLocalVideoFramePublishedHandler agora_gaming_rtc.IRtcEngine.OnFirstLocalVideoFramePublished |
OnUserSuperResolutionEnabledHandler agora_gaming_rtc.IRtcEngine.OnUserSuperResolutionEnabled |
OnUploadLogResultHandler agora_gaming_rtc.IRtcEngine.OnUploadLogResult |
OnVirtualBackgroundSourceEnabledHandler agora_gaming_rtc.IRtcEngine.OnVirtualBackgroundSourceEnabled |
OnRequestAudioFileInfoHandler agora_gaming_rtc.IRtcEngine.OnRequestAudioFileInfo |
OnContentInspectResultHandler agora_gaming_rtc.IRtcEngine.OnContentInspectResult |
OnSnapshotTakenHandler agora_gaming_rtc.IRtcEngine.OnSnapshotTaken |
OnClientRoleChangeFailedHandler agora_gaming_rtc.IRtcEngine.OnClientRoleChangeFailed |
OnAudioDeviceTestVolumeIndicationHandler agora_gaming_rtc.IRtcEngine.OnAudioDeviceTestVolumeIndication |
OnProxyConnectedHandler agora_gaming_rtc.IRtcEngine.OnProxyConnected |
OnWlAccMessageHandler agora_gaming_rtc.IRtcEngine.OnWlAccMessage |
OnWlAccStatsHandler agora_gaming_rtc.IRtcEngine.OnWlAccStats |
OnScreenCaptureInfoUpdatedHandler agora_gaming_rtc.IRtcEngine.OnScreenCaptureInfoUpdated |