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.
|
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.
In the Live Broadcast profile, when a user switches user roles after joining a channel, a successful SetClientRole
method call triggers the following callbacks:
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.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.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. |
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.
As of v3.4.5, this method only sets the publishing state of the audio stream in the channel of IRtcEngine.
A successful method call triggers the OnUserMutedAudioHandler callback on the remote client.
You can only publish the local stream in one channel at a time. If you create multiple channels, ensure that you only call MuteLocalAudioStream (false) in one channel; otherwise, the method call fails, and the SDK returns -5 (ERR_REFUSED)
.
mute | Sets whether to stop publishing the local audio stream.
|
-5 (ERR_REFUSED)
: The request is rejected. 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.
As of v3.4.5, this method only sets the publishing state of the video stream in the channel of IRtcEngine.
A successful method call triggers the OnUserMuteVideoHandler callback on the remote client.
You can only publish the local stream in one channel at a time. If you create multiple channels, ensure that you only call MuteLocalVideoStream (false) in one channel; otherwise, the method call fails, and the SDK returns -5 (ERR_REFUSED)
.
mute | Sets whether to stop publishing the local video stream.
|
-5 (ERR_REFUSED)
: The request is rejected. 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.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. On Android, Agora recommends passing a URI address or the path starts with /assets/ in this parameter. |
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 volume of the signal captured by the microphone.
volume | The volume of the signal captured by the microphone. The range is 0 to 100. The default value is 100, which represents the original volume. |
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 volume. The range is 0 to 100. The default value is 100, which represents the original volume. |
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 | 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. When you access a local file on Android, Agora recommends passing a URI address or the path starts with /assets/ in this parameter. |
loopback | Sets which user can hear the audio mixing:
|
replace | Sets the audio mixing content:
|
cycle | Sets the number of playback loops:
|
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 files 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)
.
StartAudioMixing
multiple times, ensure that the call interval is longer than 500 ms.WARN_AUDIO_MIXING_OPEN_ERROR (701)
./sdcard/
directory and the format is MP3.filePath | The absolute path or URL address (including the filename extensions) of the 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. |
loopback | Whether to only play music files 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.
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. For more information, see Custom Video Source and Renderer.
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 external audio frame. For more information, see Custom Audio Source and Renderer.
audioFrame | The audio frame: AudioFrame. |
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.
After the user successfully joins the channel, the SDK triggers the following callbacks:
COMMUNICATION
profile, or is a host in the LIVE_BROADCASTING
profile.Once the user joins the channel (switches to another channel), the user subscribes to the audio and video streams of all the other users in the channel by default, giving rise to usage and billing calculation. If you do not want to subscribe to a specified stream or all remote streams, call the mute
methods accordingly.
token | The token generated at your server. See Authenticate Your Users with Tokens. |
channelId | The name of the channel. |
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. |
ERR_INVALID_ARGUMENT
(-2)ERR_NOT_READY
(-3)ERR_REFUSED
(-5)ERR_NOT_INITIALIZED
(-7) 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.
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.AddInjectStreamUrl | ( | string | url, |
InjectStreamConfig | streamConfig | ||
) |
Adds a voice or video stream URL address to the interactive live streaming.
The OnStreamPublishedHandler callback returns the inject status. If this method call is successful, the server pulls the voice or video stream and injects it into a live channel. This is applicable to scenarios where all audience members in the channel can watch a live show and interact with each other.
The AddInjectStreamUrl
method call triggers the following callbacks:
OnUserJoinedHandler
(uid: 666), if the method call is successful and the online media stream is injected into the channel.url | The URL address which is added to the ongoing interactive live streaming. Valid protocols are RTMP, HLS, and HTTP-FLV.
|
streamConfig | The InjectStreamConfig object that contains the configuration of the added voice or video stream. |
ERR_INVALID_ARGUMENT(-2)
: The injected URL does not exist. Call this method again to inject the stream and ensure that the URL is valid. -ERR_NOT_READY(-3)
: The user is not in the channel. -ERR_NOT_SUPPORTED(-4)
: The channel profile is not interactive live streaming. Call the SetChannelProfile method and set the channel profile to interactive live streaming before calling this method. -ERR_NOT_INITIALIZED(-7)
: The SDK is not initialized. Ensure that the IRtcEngine object is initialized before calling this method. int agora_gaming_rtc.IRtcEngine.RemoveInjectStreamUrl | ( | string | url | ) |
Removes the voice or video stream URL address from the interactive live streaming.
This method removes the URL address (added by the AddInjectStreamUrl method) from the interactive live streaming.
url | The URL address of the injected stream to be removed. |
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). |
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.
After a user leaves the channel, the SDK automatically disables the built-in encryption. To re-enable the built-in encryption, call this method before the user joins the channel again.
As of v3.4.5, Agora recommends using either the AES_128_GCM2
or AES_256_GCM2
encryption mode, both of which support adding a salt and are more secure. For details, see Media Stream Encryption.
enabled | Whether to enable the built-in encryption:
|
encryptionConfig | Configurations of built-in encryption schemas. See EncryptionConfig. |
IRtcEngine
instance before calling this method. 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 the channel with a user ID.
Compared with the joinChannel
method in the IRtcEngine class, this method supports joining multiple channels at a time by creating multiple AgoraChannel objects and then calling joinChannel
in each AgoraChannel object.
Once the user joins the channel, 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 by default. Subscribing incurs all associated usage costs. To unsubscribe, set the options
parameter or call the mute
methods accordingly.
uid
.IRtcEngine
object.token | The token generated at your server. See Authenticate Your Users with Tokens. |
channelId | The name of the channel. |
info | (Optional) Additional information about the channel. This parameter can be set as null. Other users in the channel do not receive this information. |
uid | The user ID. A 32-bit unsigned integer with a value ranging from 1 to (232-1). This parameter must be unique. If uid is not assigned (or set as 0 ), the SDK assigns a uid and reports it in the OnJoinChannelSuccessHandler callback. The app must maintain this user ID. |
options | The channel media options: ChannelMediaOptions. |
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 range is 0 to 100. The default value is 100, which represents the unadjusted 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 | Recording configuration. See AudioRecordingConfiguration. |
-160(ERR_ALREADY_IN_RECORDING)
: The client is already recording audio. To start a new recording, call StopAudioRecording to stop the current recording first, and then call StartAudioRecording. int agora_gaming_rtc.IRtcEngine.EnableVirtualBackground | ( | bool | enabled, |
VirtualBackgroundSource | source | ||
) |
Enables/Disables the virtual background. (beta function)
After enabling the virtual background function, 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.
libagora_segmentation_extension.dll
(Windows)/AgoraVideoSegmentationExtension.framework
(macOS) dynamic library into the project folder.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.
|
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_INVALID_APP_ID (101)
: The App ID is invalid. Check if your App ID is in the correct format.
|
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_INVALID_APP_ID (101)
: The App ID is invalid. Check if your App ID is in the correct format.
|
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.