Inherited by agora::rtc::IRtcEngine2.
Public Types | |
typedef unsigned int | WindowIDType |
typedef HWND | WindowIDType |
Public Member Functions | |
virtual int | initialize (const RtcEngineContext &context)=0 |
virtual void | release (bool sync=false)=0 |
virtual int | setChannelProfile (CHANNEL_PROFILE_TYPE profile)=0 |
virtual int | setClientRole (CLIENT_ROLE_TYPE role)=0 |
virtual int | joinChannel (const char *token, const char *channelId, const char *info, uid_t uid)=0 |
virtual int | switchChannel (const char *token, const char *channelId)=0 |
virtual int | leaveChannel ()=0 |
virtual int | renewToken (const char *token)=0 |
virtual int | queryInterface (INTERFACE_ID_TYPE iid, void **inter)=0 |
virtual int | registerLocalUserAccount (const char *appId, const char *userAccount)=0 |
virtual int | joinChannelWithUserAccount (const char *token, const char *channelId, const char *userAccount)=0 |
virtual int | getUserInfoByUserAccount (const char *userAccount, UserInfo *userInfo)=0 |
virtual int | getUserInfoByUid (uid_t uid, UserInfo *userInfo)=0 |
virtual int | startEchoTest ()=0 |
virtual int | startEchoTest (int intervalInSeconds)=0 |
virtual int | stopEchoTest ()=0 |
virtual int | enableVideo ()=0 |
virtual int | disableVideo ()=0 |
virtual int | setVideoProfile (VIDEO_PROFILE_TYPE profile, bool swapWidthAndHeight)=0 |
virtual int | setVideoEncoderConfiguration (const VideoEncoderConfiguration &config)=0 |
virtual int | setCameraCapturerConfiguration (const CameraCapturerConfiguration &config)=0 |
virtual int | setupLocalVideo (const VideoCanvas &canvas)=0 |
virtual int | setupRemoteVideo (const VideoCanvas &canvas)=0 |
virtual int | startPreview ()=0 |
virtual int | setRemoteUserPriority (uid_t uid, PRIORITY_TYPE userPriority)=0 |
virtual int | stopPreview ()=0 |
virtual int | enableAudio ()=0 |
virtual int | enableLocalAudio (bool enabled)=0 |
virtual int | disableAudio ()=0 |
virtual int | setAudioProfile (AUDIO_PROFILE_TYPE profile, AUDIO_SCENARIO_TYPE scenario)=0 |
virtual int | muteLocalAudioStream (bool mute)=0 |
virtual int | muteAllRemoteAudioStreams (bool mute)=0 |
virtual int | setDefaultMuteAllRemoteAudioStreams (bool mute)=0 |
virtual int | adjustUserPlaybackSignalVolume (unsigned int uid, int volume)=0 |
virtual int | muteRemoteAudioStream (uid_t userId, bool mute)=0 |
virtual int | muteLocalVideoStream (bool mute)=0 |
virtual int | enableLocalVideo (bool enabled)=0 |
virtual int | muteAllRemoteVideoStreams (bool mute)=0 |
virtual int | setDefaultMuteAllRemoteVideoStreams (bool mute)=0 |
virtual int | muteRemoteVideoStream (uid_t userId, bool mute)=0 |
virtual int | setRemoteVideoStreamType (uid_t userId, REMOTE_VIDEO_STREAM_TYPE streamType)=0 |
virtual int | setRemoteDefaultVideoStreamType (REMOTE_VIDEO_STREAM_TYPE streamType)=0 |
virtual int | enableAudioVolumeIndication (int interval, int smooth, bool report_vad)=0 |
virtual int | startAudioRecording (const char *filePath, AUDIO_RECORDING_QUALITY_TYPE quality)=0 |
virtual int | startAudioRecording (const char *filePath, int sampleRate, AUDIO_RECORDING_QUALITY_TYPE quality)=0 |
virtual int | stopAudioRecording ()=0 |
virtual int | startAudioMixing (const char *filePath, bool loopback, bool replace, int cycle)=0 |
virtual int | stopAudioMixing ()=0 |
virtual int | pauseAudioMixing ()=0 |
virtual int | resumeAudioMixing ()=0 |
virtual int | setHighQualityAudioParameters (bool fullband, bool stereo, bool fullBitrate)=0 |
virtual int | adjustAudioMixingVolume (int volume)=0 |
virtual int | adjustAudioMixingPlayoutVolume (int volume)=0 |
virtual int | getAudioMixingPlayoutVolume ()=0 |
virtual int | adjustAudioMixingPublishVolume (int volume)=0 |
virtual int | getAudioMixingPublishVolume ()=0 |
virtual int | getAudioMixingDuration ()=0 |
virtual int | getAudioMixingCurrentPosition ()=0 |
virtual int | setAudioMixingPosition (int pos)=0 |
virtual int | getEffectsVolume ()=0 |
virtual int | setEffectsVolume (int volume)=0 |
virtual int | setVolumeOfEffect (int soundId, int volume)=0 |
virtual int | playEffect (int soundId, const char *filePath, int loopCount, double pitch, double pan, int gain, bool publish=false)=0 |
virtual int | stopEffect (int soundId)=0 |
virtual int | stopAllEffects ()=0 |
virtual int | preloadEffect (int soundId, const char *filePath)=0 |
virtual int | unloadEffect (int soundId)=0 |
virtual int | pauseEffect (int soundId)=0 |
virtual int | pauseAllEffects ()=0 |
virtual int | resumeEffect (int soundId)=0 |
virtual int | resumeAllEffects ()=0 |
virtual int | enableSoundPositionIndication (bool enabled)=0 |
virtual int | setRemoteVoicePosition (uid_t uid, double pan, double gain)=0 |
virtual int | setLocalVoicePitch (double pitch)=0 |
virtual int | setLocalVoiceEqualization (AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, int bandGain)=0 |
virtual int | setLocalVoiceReverb (AUDIO_REVERB_TYPE reverbKey, int value)=0 |
virtual int | setLocalVoiceChanger (VOICE_CHANGER_PRESET voiceChanger)=0 |
virtual int | setLocalVoiceReverbPreset (AUDIO_REVERB_PRESET reverbPreset)=0 |
virtual int | setLogFile (const char *filePath)=0 |
virtual int | setLogFilter (unsigned int filter)=0 |
virtual int | setLogFileSize (unsigned int fileSizeInKBytes)=0 |
virtual int | setLocalRenderMode (RENDER_MODE_TYPE renderMode)=0 |
virtual int | setLocalRenderMode (RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode)=0 |
virtual int | setRemoteRenderMode (uid_t userId, RENDER_MODE_TYPE renderMode)=0 |
virtual int | setRemoteRenderMode (uid_t userId, RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode)=0 |
virtual int | setLocalVideoMirrorMode (VIDEO_MIRROR_MODE_TYPE mirrorMode)=0 |
virtual int | enableDualStreamMode (bool enabled)=0 |
virtual int | setExternalAudioSource (bool enabled, int sampleRate, int channels)=0 |
virtual int | setExternalAudioSink (bool enabled, int sampleRate, int channels)=0 |
virtual int | setRecordingAudioFrameParameters (int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall)=0 |
virtual int | setPlaybackAudioFrameParameters (int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall)=0 |
virtual int | setMixedAudioFrameParameters (int sampleRate, int samplesPerCall)=0 |
virtual int | adjustRecordingSignalVolume (int volume)=0 |
virtual int | adjustPlaybackSignalVolume (int volume)=0 |
virtual int | enableWebSdkInteroperability (bool enabled)=0 |
virtual int | setVideoQualityParameters (bool preferFrameRateOverImageQuality)=0 |
virtual int | setLocalPublishFallbackOption (STREAM_FALLBACK_OPTIONS option)=0 |
virtual int | setRemoteSubscribeFallbackOption (STREAM_FALLBACK_OPTIONS option)=0 |
virtual int | switchCamera ()=0 |
virtual int | setDefaultAudioRouteToSpeakerphone (bool defaultToSpeaker)=0 |
virtual int | setEnableSpeakerphone (bool speakerOn)=0 |
virtual int | enableInEarMonitoring (bool enabled)=0 |
virtual int | setInEarMonitoringVolume (int volume)=0 |
virtual bool | isSpeakerphoneEnabled ()=0 |
virtual int | setAudioSessionOperationRestriction (AUDIO_SESSION_OPERATION_RESTRICTION restriction)=0 |
virtual int | enableLoopbackRecording (bool enabled, const char *deviceName=NULL)=0 |
virtual int | startScreenCaptureByDisplayId (unsigned int displayId, const Rectangle ®ionRect, const ScreenCaptureParameters &captureParams)=0 |
virtual int | startScreenCaptureByScreenRect (const Rectangle &screenRect, const Rectangle ®ionRect, const ScreenCaptureParameters &captureParams)=0 |
virtual int | startScreenCaptureByWindowId (view_t windowId, const Rectangle ®ionRect, const ScreenCaptureParameters &captureParams)=0 |
virtual int | setScreenCaptureContentHint (VideoContentHint contentHint)=0 |
virtual int | updateScreenCaptureParameters (const ScreenCaptureParameters &captureParams)=0 |
virtual int | updateScreenCaptureRegion (const Rectangle ®ionRect)=0 |
virtual int | stopScreenCapture ()=0 |
virtual int | startScreenCapture (WindowIDType windowId, int captureFreq, const Rect *rect, int bitrate)=0 |
virtual int | updateScreenCaptureRegion (const Rect *rect)=0 |
virtual int | getCallId (agora::util::AString &callId)=0 |
virtual int | rate (const char *callId, int rating, const char *description)=0 |
virtual int | complain (const char *callId, const char *description)=0 |
virtual const char * | getVersion (int *build)=0 |
virtual int | enableLastmileTest ()=0 |
virtual int | disableLastmileTest ()=0 |
virtual int | startLastmileProbeTest (const LastmileProbeConfig &config)=0 |
virtual int | stopLastmileProbeTest ()=0 |
virtual const char * | getErrorDescription (int code)=0 |
virtual int | setEncryptionSecret (const char *secret)=0 |
virtual int | setEncryptionMode (const char *encryptionMode)=0 |
virtual int | registerPacketObserver (IPacketObserver *observer)=0 |
virtual int | createDataStream (int *streamId, bool reliable, bool ordered)=0 |
virtual int | sendStreamMessage (int streamId, const char *data, size_t length)=0 |
virtual int | addPublishStreamUrl (const char *url, bool transcodingEnabled)=0 |
virtual int | removePublishStreamUrl (const char *url)=0 |
virtual int | setLiveTranscoding (const LiveTranscoding &transcoding)=0 |
virtual int | addVideoWatermark (const RtcImage &watermark)=0 |
virtual int | addVideoWatermark (const char *watermarkUrl, const WatermarkOptions &options)=0 |
virtual int | clearVideoWatermarks ()=0 |
virtual int | setBeautyEffectOptions (bool enabled, BeautyOptions options)=0 |
virtual int | addInjectStreamUrl (const char *url, const InjectStreamConfig &config)=0 |
virtual int | startChannelMediaRelay (const ChannelMediaRelayConfiguration &configuration)=0 |
virtual int | updateChannelMediaRelay (const ChannelMediaRelayConfiguration &configuration)=0 |
virtual int | stopChannelMediaRelay ()=0 |
virtual int | removeInjectStreamUrl (const char *url)=0 |
virtual bool | registerEventHandler (IRtcEngineEventHandler *eventHandler)=0 |
virtual bool | unregisterEventHandler (IRtcEngineEventHandler *eventHandler)=0 |
virtual CONNECTION_STATE_TYPE | getConnectionState ()=0 |
virtual int | registerMediaMetadataObserver (IMetadataObserver *observer, IMetadataObserver::METADATA_TYPE type)=0 |
virtual int | setParameters (const char *parameters)=0 |
Protected Member Functions | |
virtual | ~IRtcEngine () |
IRtcEngine is the base interface class of the Agora SDK that provides the main Agora SDK methods invoked by your application.
Enable the Agora SDK's communication functionality through the creation of an IRtcEngine object, then call the methods of this object.
typedef unsigned int agora::rtc::IRtcEngine::WindowIDType |
typedef HWND agora::rtc::IRtcEngine::WindowIDType |
|
inlineprotectedvirtual |
|
pure virtual |
Initializes the Agora service.
Ensure that you call the createAgoraRtcEngine and initialize methods before calling any other API.
context | Pointer to the RTC engine context. See RtcEngineContext. |
ERR_INVALID_APP_ID (101)
: The app ID is invalid. Check if it is in the correct format.
|
pure virtual |
Releases all IRtcEngine resources.
sync |
|
|
pure virtual |
Sets the channel profile of the Agora RtcEngine.
The Agora RtcEngine 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 RtcEngine. See CHANNEL_PROFILE_TYPE |
|
pure virtual |
Sets the role of the user, such as a host or an audience (default), before joining a channel in a live broadcast.
This method can be used to switch the user role in a live broadcast after the user joins a channel.
In the Live Broadcast profile, when a user switches user roles after joining a channel, a successful setClientRole method call triggers the following callbacks:
role | Sets the role of the user. See CLIENT_ROLE_TYPE. |
|
pure virtual |
Joins a channel with the user ID.
Users in the same channel can talk to each other, and multiple users in the same channel can start a group chat. Users with different App IDs cannot call each other.
You must call the leaveChannel method to exit the current call before entering another channel.
A successful joinChannel method call triggers the following callbacks:
When the connection between the client and Agora's server is interrupted due to poor network conditions, the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the onRejoinChannelSuccess callback on the local client.
uid
. If you set uid
as 0, the system automatically assigns a uid
. If you want to join a channel from different devices, ensure that each device has a different uid. token | Pointer to the token generated by the application server. In most circumstances, a static App ID suffices. For added security, use a Channel Key.
|
channelId | Pointer to the unique channel name for the Agora RTC session in the string format smaller than 64 bytes. Supported characters:
|
info | (Optional) Pointer to additional information about the channel. This parameter can be set to NULL or contain channel related information. Other users in the channel will not receive this message. |
uid | (Optional) User ID. A 32-bit unsigned integer with a value ranging from 1 to 232-1. The uid must be unique. If a uid is not assigned (or set to 0), the SDK assigns and returns a uid in the onJoinChannelSuccess callback. Your application must record and maintain the returned uid since the SDK does not do so. |
|
pure virtual |
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 onLeaveChannel and onJoinChannelSuccess callbacks are triggered to indicate that the user has left the original channel and joined a new one.
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:
|
|
pure virtual |
Allows a user to leave a channel, such as hanging up or exiting a call.
After joining a channel, the user must call the leaveChannel method to end the call before joining another channel.
This method returns 0 if the user leaves the channel and releases all resources related to the call.
This method call is asynchronous, and the user has not left the channel when the method call returns. Once the user leaves the channel, the SDK triggers the onLeaveChannel callback.
A successful leaveChannel method call triggers the following callbacks:
|
pure virtual |
Gets a new token when the current token expires after a period of time.
The token
expires after a period of time once the token schema is enabled when:
The application should call this method to get the new token
. Failure to do so will result in the SDK disconnecting from the server.
token | Pointer to the new token. |
|
pure virtual |
Retrieves the pointer to the device manager object.
iid | ID of the interface. |
inter | Pointer to the DeviceManager object. |
|
pure virtual |
Registers a user account.
Once registered, the user account can be used to identify the local user when the user joins the channel. After the user successfully registers a user account, the SDK triggers the onLocalUserRegistered callback on the local client, reporting the user ID and user account of the local user.
To join a channel with a user account, you can choose either of the following:
The difference between the two is that for the former, the time elapsed between calling the joinChannelWithUserAccount method and joining the channel is shorter than the latter.
userAccount
parameter. Otherwise, this method does not take effect.userAccount
parameter is unique in the channel.appId | The App ID of your project. |
userAccount | The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
|
|
pure virtual |
Joins the channel with a user account.
After the user successfully joins the channel, the SDK triggers the following callbacks:
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:
|
|
pure virtual |
Gets the user information by passing in the user account.
After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object (userInfo
), and triggers the onUserInfoUpdated callback on the local client.
After receiving the oonUserInfoUpdated callback, you can call this method to get the user ID of the remote user from the userInfo
object by passing in the user account.
userAccount | The user account of the user. Ensure that you set this parameter. |
userInfo | A userInfo object that identifies the user:
|
|
pure virtual |
Gets the user information by passing in the user ID.
After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object (userInfo
), and triggers the onUserInfoUpdated callback on the local client.
After receiving the onUserInfoUpdated callback, you can call this method to get the user account of the remote user from the userInfo
object by passing in the user ID.
uid | The user ID of the remote user. Ensure that you set this parameter. |
userInfo | A userInfo object that identifies the user:
|
|
pure virtual |
DEPRECATED Starts an audio call test.
This method is deprecated as of v2.4.0.
This method starts an audio call test to check whether the audio devices (for example, headset and speaker) and the network connection are working properly.
To conduct the test:
|
pure virtual |
Starts an audio call test.
This method starts an audio call test to determine whether the audio devices (for example, headset and speaker) and the network connection are working properly.
In the audio call test, you record your voice. If the recording plays back within the set time interval, the audio devices and the network connection are working properly.
intervalInSeconds | The time interval (s) between when you speak and when the recording plays back. |
|
pure virtual |
Stops the audio call test.
|
pure virtual |
Enables the video module.
Call this method either before joining a channel or during a call. If this method is called before joining a channel, the call starts in the video mode. If this method is called during an audio call, the audio mode switches to the video mode. To disable the video module, call the disableVideo method.
A successful enableVideo method call triggers the onUserEnableVideo (true) callback on the remote client.
|
pure virtual |
Disables the video module.
This method can be called before joining a channel or during a call. If this method is called before joining a channel, the call starts in audio mode. If this method is called during a video call, the video mode switches to the audio mode. To enable the video module, call the enableVideo method.
A successful disableVideo method call triggers the onUserEnableVideo (false) callback on the remote client.
|
pure virtual |
DEPRECATED Sets the video profile.
This method is deprecated as of v2.3. Use the setVideoEncoderConfiguration method instead.
Each video profile includes a set of parameters, such as the resolution, frame rate, and bitrate. If the camera device does not support the specified resolution, the SDK automatically chooses a suitable camera resolution, keeping the encoder resolution specified by the setVideoProfile method.
profile | Sets the video profile. See VIDEO_PROFILE_TYPE. |
swapWidthAndHeight | Sets whether to swap the width and height of the video stream:
|
|
pure virtual |
Sets the video encoder configuration.
Each video encoder configuration corresponds to a set of video parameters, including the resolution, frame rate, bitrate, and video orientation.
The parameters specified in this method are the maximum values under ideal network conditions. If the video engine cannot render the video using the specified parameters due to poor network conditions, the parameters further down the list are considered until a successful configuration is found.
config | Sets the local video encoder configuration. See VideoEncoderConfiguration. |
|
pure virtual |
Sets the camera capture configuration.
For a video call or live broadcast, generally the SDK controls the camera output parameters. When the default camera capturer settings do not meet special requirements or cause performance problems, we recommend using this method to set the camera capturer configuration:
config | Sets the camera capturer configuration. See CameraCapturerConfiguration. |
|
pure virtual |
Initializes the local video view.
This method initializes the video view of a local stream on the local device. It affects only the video view that the local user sees, not the published local video stream.
Call this method to bind the local video stream to a video view and to set the rendering and mirror modes of the video view. The binding is still valid after the user leaves the channel, which means that the window still displays. To unbind the view, set the view in VideoCanvas to NULL.
canvas | Pointer to the local video view and settings. See VideoCanvas. |
|
pure virtual |
Initializes the video view of a remote user.
This method initializes the video view of a remote stream on the local device. It affects only the video view that the local user sees.
Call this method to bind the remote video stream to a video view and to set the rendering and mirror modes of the video view.
The application specifies the uid of the remote video in this method before the remote user joins the channel. If the remote uid is unknown to the application, set it after the application receives the onUserJoined callback. If the Video Recording function is enabled, the Video Recording Service joins the channel as a dummy client, causing other clients to also receive the onUserJoined callback. Do not bind the dummy client to the application view because the dummy client does not send any video streams. If your application does not recognize the dummy client, bind the remote user to the view when the SDK triggers the onFirstRemoteVideoDecoded callback. To unbind the remote user from the view, set the view in VideoCanvas to NULL. Once the remote user leaves the channel, the SDK unbinds the remote user.
canvas | Pointer to the remote video view and settings. See VideoCanvas. |
|
pure virtual |
Starts the local video preview before joining the channel.
Before calling this method, you must:
|
pure virtual |
Prioritizes a remote user's stream.
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. |
|
pure virtual |
Stops the local video preview and disables video.
|
pure virtual |
Enables the audio module.
The audio mode is enabled by default.
|
pure virtual |
Disables/Re-enables the local audio function.
The audio function is enabled by default. This method disables or re-enables the local audio function, that is, to stop or restart local audio capturing.
This method does not affect receiving or playing the remote audio streams,and enableLocalAudio(false) is applicable to scenarios where the user wants to receive remote audio streams without sending any audio stream to other users in the channel.
The SDK triggers the onMicrophoneEnabled callback once the local audio function is disabled or enabled.
enableLocalAudio
method, the local user may hear a pause in the remote audio playback.enabled | Sets whether to disable/re-enable the local audio function:
|
|
pure virtual |
Disables the audio module.
|
pure virtual |
Sets the audio parameters and application scenarios.
profile | Sets the sample rate, bitrate, encoding mode, and the number of channels. See AUDIO_PROFILE_TYPE. |
scenario | Sets the audio application scenario. See AUDIO_SCENARIO_TYPE. Under different audio scenarios, the device uses different volume 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?. |
|
pure virtual |
Stops/Resumes sending the local audio stream.
A successful muteLocalAudioStream method call triggers the onUserMuteAudio callback on the remote client.
mute
is set as true
, this method does not disable the microphone, which does not affect any ongoing recording.setChannelProfile
method.mute | Sets whether to send/stop sending the local audio stream:
|
|
pure virtual |
Stops/Resumes receiving all remote users' audio streams.
mute | Sets whether to receive/stop receiving all remote users' audio streams.
|
|
pure virtual |
Sets whether to receive all remote audio streams by default.
You can call this method either before or after joining a channel. If you call setDefaultMuteAllRemoteAudioStreams (true)
after joining a channel, the remote audio streams of all subsequent users are not received.
muteRemoteAudioStream (false)
as many times. Calling setDefaultMuteAllRemoteAudioStreams (false)
resumes receiving the audio streams of subsequent users only.mute | Sets whether to receive/stop receiving all remote users' audio streams by default:
|
|
pure virtual |
Adjusts the playback volume of a specified remote user.
You can call this method as many times as necessary to adjust the playback volume of different remote users, or to repeatedly adjust the playback volume of the same remote user.
uid | The ID of the remote user. |
volume | The playback volume of the specified remote user. The value ranges from 0 to 100:
|
|
pure virtual |
Stops/Resumes receiving a specified remote user's audio stream.
mute
as true
to stop receiving all remote users' audio streams, call the muteAllRemoteAudioStreams method and set mute
as false
before calling this method. The muteAllRemoteAudioStreams method sets all remote audio streams, while the muteRemoteAudioStream method sets a specified remote audio stream.userId | User ID of the specified remote user sending the audio. |
mute | Sets whether to receive/stop receiving a specified remote user's audio stream:
|
|
pure virtual |
Stops/Resumes sending the local video stream.
A successful muteLocalVideoStream method call triggers the onUserMuteVideo callback on the remote client.
setChannelProfile
method.mute | Sets whether to send/stop sending the local video stream:
|
|
pure virtual |
Enables/Disables the local video capture.
This method disables or re-enables the local video capturer, and does not affect receiving the remote video stream.
After you call the enableVideo method, the local video capturer is enabled by default. You can call enableLocalVideo(false) to disable the local video capturer. If you want to re-enable it, call enableLocalVideo(true).
After the local video capturer is successfully disabled or re-enabled, the SDK triggers the onUserEnableLocalVideo callback on the remote client.
enabled | Sets whether to disable/re-enable the local video, including the capturer, renderer, and sender:
|
|
pure virtual |
Stops/Resumes receiving all video stream from a specified remote user.
mute | Sets whether to receive/stop receiving all remote users' video streams:
|
|
pure virtual |
Sets whether to receive all remote video streams by default.
You can call this method either before or after joining a channel. If you call setDefaultMuteAllRemoteVideoStreams (true)
after joining a channel, the remote video streams of all subsequent users are not received.
muteRemoteVideoStream (false)
as many times. Calling setDefaultMuteAllRemoteVideoStreams (false)
resumes receiving the video streams of subsequent users only.mute | Sets whether to receive/stop receiving all remote users' video streams by default:
|
|
pure virtual |
Stops/Resumes receiving the video stream from a specified remote user.
mute
as true
to stop receiving all remote video streams, call the muteAllRemoteVideoStreams method and set mute
as false
before calling this method.userId | User ID of the specified remote user. |
mute | Sets whether to stop/resume receiving the video stream from a specified remote user:
|
|
pure virtual |
Sets the remote user's video stream type received by the local user when the remote user sends dual streams.
This method allows the application to adjust the corresponding video-stream type based on the size of the video window to reduce the bandwidth and resources.
The method result returns in the onApiCallExecuted callback. The SDK receives the high-stream video by default to reduce the bandwidth. If needed, users may use this method to switch to the low-stream video. By default, the aspect ratio of the low-stream video is the same as the high-stream video. Once the resolution of the high-stream video is set, the system automatically sets the resolution, frame rate, and bitrate of the low-stream video.
userId | ID of the remote user sending the video stream. |
streamType | Sets the video-stream type. See REMOTE_VIDEO_STREAM_TYPE. |
|
pure virtual |
Sets the default 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 onApiCallExecuted callback. The Agora 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.
streamType | Sets the default video-stream type. See REMOTE_VIDEO_STREAM_TYPE. |
|
pure virtual |
Enables the onAudioVolumeIndication callback at a set time interval to report on which users are speaking and the speakers' volume.
Once this method is enabled, the SDK returns the volume indication in the onAudioVolumeIndication callback at the set time interval, whether or not any user is speaking in the channel.
interval | Sets the time interval between two consecutive volume indications:
|
smooth | Smoothing factor sets the sensitivity of the audio volume indicator. The value ranges between 0 and 10. The greater the value, the more sensitive the indicator. The recommended value is 3. |
report_vad |
|
|
pure virtual |
DEPRECATED Starts an audio recording. Use startAudioRecording2 instead.
The SDK allows recording during a call. Supported formats:
This method has a fixed sample rate of 32 kHz.
Ensure that the directory to save the recording file exists and is writable. This method is usually called after the joinChannel method. The recording automatically stops when the leaveChannel method is called.
filePath | Pointer to the absolute file path of the recording file. The string of the file name is in UTF-8. |
quality | Sets the audio recording quality. See AUDIO_RECORDING_QUALITY_TYPE. |
|
pure virtual |
Starts an audio recording on the client.
The SDK allows recording during a call. After successfully calling this method, you can record the audio of all the users in the channel and get an audio recording file. Supported formats of the recording file are as follows:
joinChannel
method. The recording automatically stops when you call the leaveChannel
method.sampleRate
is 44.1 kHz or 48 kHz.filePath | Pointer to the absolute file path of the recording file. The string of the file name is in UTF-8, such as c:/music/audio.aac. |
sampleRate | Sample rate (kHz) of the recording file. Supported values are as follows:
|
quality | Sets the audio recording quality. See AUDIO_RECORDING_QUALITY_TYPE. |
|
pure virtual |
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.
|
pure virtual |
Starts playing and mixing the music file.
This method mixes the specified local audio file with the audio stream from the microphone, or replaces the microphone's audio stream with the specified local audio file. You can choose whether the other user can hear the local audio playback and specify the number of playback loops. This method also supports online music playback.
When the audio mixing file playback finishes after calling this method, the SDK triggers the onAudioMixingFinished callback.
A successful startAudioMixing method call triggers the onAudioMixingStateChanged (PLAY) callback on the local client.
When the audio mixing file playback finishes, the SDK triggers the onAudioMixingStateChanged (STOPPED) callback on the local client.
filePath | Pointer to the absolute path (including the suffixes of the filename) of the local or online audio file to mix, for example, c:/music/audio.mp4. Supported audio formats: 3GP, ASF, ADTS, AVI, MP3, MP4, MPEG-4, SAMI, and WAVE. 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:
|
|
pure virtual |
Stops playing and mixing the music file.
Call this method when you are in a channel.
|
pure virtual |
Pauses playing and mixing the music file.
Call this method when you are in a channel.
|
pure virtual |
Resumes playing and mixing the music file.
Call this method when you are in a channel.
|
pure virtual |
DEPRECATED Agora does not recommend using this method.
Sets the high-quality audio preferences. Call this method and set all parameters before joining a channel.
Do not call this method again after joining a channel.
fullband | Sets whether to enable/disable full-band codec (48-kHz sample rate). Not compatible with SDK versions before v1.7.4:
|
stereo | Sets whether to enable/disable stereo codec. Not compatible with SDK versions before v1.7.4:
|
fullBitrate | Sets whether to enable/disable high-bitrate mode. Recommended in voice-only mode:
|
|
pure virtual |
Adjusts the volume during audio mixing.
Call this method when you are in a channel.
volume | Audio mixing volume. The value ranges between 0 and 100 (default). |
|
pure virtual |
Adjusts the audio mixing volume for local playback.
volume | Audio mixing volume for local playback. The value ranges between 0 and 100 (default). |
|
pure virtual |
Retrieves the audio mixing volume for local playback.
This method helps troubleshoot audio volume related issues.
|
pure virtual |
Adjusts the audio mixing volume for publishing (for remote users).
volume | Audio mixing volume for publishing. The value ranges between 0 and 100 (default). |
|
pure virtual |
Retrieves the audio mixing volume for publishing.
This method helps troubleshoot audio volume related issues.
|
pure virtual |
Gets the duration (ms) of the music file.
Call this method when you are in a channel.
|
pure virtual |
Gets the playback position (ms) of the music file.
Call this method when you are in a channel.
|
pure virtual |
Sets the playback position of the music file to a different starting position (the default plays from the beginning).
pos | The playback starting position (ms) of the music file. |
|
pure virtual |
Retrieves the volume of the audio effects.
The value ranges between 0.0 and 100.0.
|
pure virtual |
Sets the volume of the audio effects.
volume | Sets the volume of the audio effects. The value ranges between 0 and 100 (default). |
|
pure virtual |
Sets the volume of a specified audio effect.
soundId | ID of the audio effect. Each audio effect has a unique ID. |
volume | Sets the volume of the specified audio effect. The value ranges between 0 and 100 (default). |
|
pure virtual |
Plays a specified local or online audio effect file.
This method allows you to set the loop count, pitch, pan, and gain of the audio effect file, as well as whether the remote user can hear the audio effect.
To play multiple audio effect files simultaneously, call this method multiple times with different soundIds and filePaths. We recommend playing no more than three audio effect files at the same time.
soundId | ID of the specified audio effect. Each audio effect has a unique ID. |
soundID
must be the same as that in the preloadEffect method.filePath | Specifies the absolute path (including the suffixes of the filename) to the local audio effect file or the URL of the online audio effect file, for example, c:/music/audio.mp4. Supported audio formats: mp3, mp4, m4a, aac, 3gp, mkv and wav. |
loopCount | Sets the number of times the audio effect loops:
|
pitch | Sets the pitch of the audio effect. The value ranges between 0.5 and 2. The default value is 1 (no change to the pitch). The lower the value, the lower the pitch. |
pan | Sets the spatial position of the audio effect. The value ranges between -1.0 and 1.0:
|
gain | Sets the volume of the audio effect. The value ranges between 0 and 100 (default). The lower the value, the lower the volume of the audio effect. |
publish | Sets whether or not to publish the specified audio effect to the remote stream:
|
|
pure virtual |
Stops playing a specified audio effect.
soundId | ID of the audio effect to stop playing. Each audio effect has a unique ID. |
|
pure virtual |
Stops playing all audio effects.
|
pure virtual |
Preloads a specified audio effect file into the memory.
To ensure smooth communication, limit the size of the audio effect file. We recommend using this method to preload the audio effect before calling the joinChannel method.
Supported audio formats: mp3, aac, m4a, 3gp, and wav.
soundId | ID of the audio effect. Each audio effect has a unique ID. |
filePath | Pointer to the absolute path of the audio effect file. |
|
pure virtual |
Releases a specified preloaded audio effect from the memory.
soundId | ID of the audio effect. Each audio effect has a unique ID. |
|
pure virtual |
Pauses a specified audio effect.
soundId | ID of the audio effect. Each audio effect has a unique ID. |
|
pure virtual |
Pauses all audio effects.
|
pure virtual |
Resumes playing a specified audio effect.
soundId | ID of the audio effect. Each audio effect has a unique ID. |
|
pure virtual |
Resumes playing all audio effects.
|
pure virtual |
Enables/Disables stereo panning for remote users.
Ensure that you call this method before joinChannel to enable stereo panning for remote users so that the local user can track the position of a remote user by calling setRemoteVoicePosition.
enabled | Sets whether or not to enable stereo panning for remote users:
|
|
pure virtual |
Sets the sound position and gain of a remote user.
When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, such as Battle Royale games.
uid | The ID of the remote user. |
pan | The sound position of the remote user. The value ranges from -1.0 to 1.0:
|
gain | Gain of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original gain of the remote user). The smaller the value, the less the gain. |
|
pure virtual |
Changes the voice pitch of the local speaker.
pitch | Sets the voice pitch. The value ranges between 0.5 and 2.0. The lower the value, the lower the voice pitch. The default value is 1.0 (no change to the local voice pitch). |
|
pure virtual |
Sets the local voice equalization effect.
bandFrequency | Sets the band frequency. The value ranges between 0 and 9, representing the respective 10-band center frequencies of the voice effects, including 31, 62, 125, 500, 1k, 2k, 4k, 8k, and 16k Hz. See AUDIO_EQUALIZATION_BAND_FREQUENCY. |
bandGain | Sets the gain of each band in dB. The value ranges between -15 and 15. |
|
pure virtual |
Sets the local voice reverberation.
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. |
|
pure virtual |
Sets the local voice changer option.
voiceChanger | Sets the local voice changer option. See VOICE_CHANGER_PRESET. |
|
pure virtual |
Sets the preset local voice reverberation effect.
reverbPreset | Sets the preset audio reverberation configuration. See AUDIO_REVERB_PRESET. |
|
pure virtual |
Specifies an SDK output log file.
The log file records all SDK operations during runtime. If it does not exist, the SDK creates one.
C:\Users\<user_name>\AppData\Local\Agora\<process_name>
.filePath | File path of the log file. The string of the log file is in UTF-8. |
|
pure virtual |
Sets the output log level of the SDK.
You can use one or a combination of the log filter levels. The log level follows the sequence of OFF, CRITICAL, ERROR, WARNING, INFO, and DEBUG. Choose a level to see the logs preceding that level.
If you set the log level to WARNING, you see the logs within levels CRITICAL, ERROR, and WARNING.
filter | Sets the log filter level. See LOG_FILTER_TYPE. |
|
pure virtual |
Sets the log file size (KB).
The SDK has two log files, each with a default size of 512 KB. If you set fileSizeInBytes
as 1024 KB, the SDK outputs log files with a total maximum size of 2 MB. If the total size of the log files exceed the set value, the new output log files overwrite the old output log files.
fileSizeInKBytes | The SDK log file size (KB). |
|
pure virtual |
This method can be called multiple times during a call to change the display mode.
renderMode | Sets the local video display mode. See RENDER_MODE_TYPE. |
|
pure virtual |
Updates the display mode of the local video view.
After initializing the local video view, you can call this method to update its rendering and mirror modes. It affects only the video view that the local user sees, not the published local video stream.
renderMode | The rendering mode of the local video view. See RENDER_MODE_TYPE. |
mirrorMode |
|
|
pure virtual |
This method can be called multiple times during a call to change the display mode.
userId | ID of the remote user. |
renderMode | Sets the video display mode. See RENDER_MODE_TYPE. |
|
pure virtual |
Updates the display mode of the video view of a remote user.
After initializing the video view of a remote user, you can call this method to update its rendering and mirror modes. This method affects only the video view that the local user sees.
userId | The ID of the remote user. |
renderMode | The rendering mode of the remote video view. See RENDER_MODE_TYPE. |
mirrorMode |
|
|
pure virtual |
Sets the local video mirror mode.
You must call this method before calling the startPreview method, otherwise the mirror mode will not work.
mirrorMode | Sets the local video mirror mode. See VIDEO_MIRROR_MODE_TYPE. |
|
pure virtual |
Sets the stream mode to the single-stream (default) or dual-stream mode. (Live broadcast only.)
If the dual-stream mode is enabled, the receiver can choose to receive the high stream (high-resolution and high-bitrate video stream), or the low stream (low-resolution and low-bitrate video stream).
enabled | Sets the stream mode:
|
|
pure virtual |
Sets the external audio source. Please call this method before joinChannel.
enabled | Sets whether to enable/disable the external audio source:
|
sampleRate | Sets the sample rate (Hz) of the external audio source, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
channels | Sets the number of audio channels of the external audio source:
|
|
pure virtual |
Sets the external audio sink. This method applies to scenarios where you want to use external audio data for playback. After enabling the external audio sink, you can call the pullAudioFrame method to pull the remote audio data, process it, and play it with the audio effects that you want.
enabled |
|
sampleRate | Sets the sample rate (Hz) of the external audio sink, which can be set as 16000, 32000, 44100 or 48000. |
channels | Sets the number of audio channels of the external audio sink:
|
|
pure virtual |
Sets the audio recording format for the onRecordAudioFrame callback.
sampleRate | Sets the sample rate (samplesPerSec ) returned in the onRecordAudioFrame callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
channel | Sets the number of audio channels (channels ) returned in the onRecordAudioFrame callback:
|
mode | Sets the use mode (see RAW_AUDIO_FRAME_OP_MODE_TYPE) of the onRecordAudioFrame callback. |
samplesPerCall | Sets the number of samples returned in the onRecordAudioFrame callback. samplesPerCall is usually set as 1024 for RTMP streaming. |
onRecordAudioFrame
callback according to the sample interval. Ensure that the sample interval ≥ 0.01 (s). And, Sample interval (sec) = samplePerCall
/(sampleRate
× channel
).
|
pure virtual |
Sets the audio playback format for the onPlaybackAudioFrame callback.
sampleRate | Sets the sample rate (samplesPerSec ) returned in the onPlaybackAudioFrame callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
channel | Sets the number of channels (channels ) returned in the onPlaybackAudioFrame callback:
|
mode | Sets the use mode (see RAW_AUDIO_FRAME_OP_MODE_TYPE) of the onPlaybackAudioFrame callback. |
samplesPerCall | Sets the number of samples returned in the onPlaybackAudioFrame callback. samplesPerCall is usually set as 1024 for RTMP streaming. |
onPlaybackAudioFrame
callback according to the sample interval. Ensure that the sample interval ≥ 0.01 (s). And, Sample interval (sec) = samplePerCall
/(sampleRate
× channel
).
|
pure virtual |
Sets the mixed audio format for the onMixedAudioFrame callback.
sampleRate | Sets the sample rate (samplesPerSec ) returned in the onMixedAudioFrame callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
samplesPerCall | Sets the number of samples (samples ) returned in the onMixedAudioFrame callback. samplesPerCall is usually set as 1024 for RTMP streaming. |
onMixedAudioFrame
callback according to the sample interval. Ensure that the sample interval ≥ 0.01 (s). And, Sample interval (sec) = samplePerCall
/(sampleRate
× channels
).
|
pure virtual |
Adjusts the recording volume.
volume | Recording volume. The value ranges between 0 and 400:
|
|
pure virtual |
Adjusts the playback volume of all remote users.
adjustPlaybackSignalVolume
and adjustAudioMixingVolume methods and set the volume as 0
.volume | The playback volume of all remote users. The value ranges from 0 to 400:
|
|
pure virtual |
enabled | Sets whether to enable/disable interoperability with the Agora Web SDK:
|
|
pure virtual |
DEPRECATED Sets the preferences for the high-quality video. (Live broadcast only).
This method is deprecated as of v2.4.0.
preferFrameRateOverImageQuality | Sets the video quality preference:
|
|
pure virtual |
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 onLocalPublishFallbackToAudioOnly callback.
option | Sets the fallback option for the locally published video stream:
|
|
pure virtual |
Sets the fallback option for the remotely subscribed video stream based on the network conditions.
The default setting for option
is STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW (1), where the remotely subscribed video stream falls back to the low-stream video (low resolution and low bitrate) under poor downlink network conditions.
If option
is set as STREAM_FALLBACK_OPTION_AUDIO_ONLY (2), the SDK automatically switches the video from a high-stream to a low-stream, or disables the video when the downlink network conditions cannot support both audio and video to guarantee the quality of the audio. The SDK monitors the network quality and restores the video stream when the network conditions improve.
When the remotely subscribed video stream falls back to audio only or when the audio-only stream switches back to the video stream, the SDK triggers the onRemoteSubscribeFallbackToAudioOnly callback.
option | Sets the fallback option for the remotely subscribed video stream. See STREAM_FALLBACK_OPTIONS. |
|
pure virtual |
Switches between front and rear cameras.
|
pure virtual |
Sets the default audio 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:
defaultToSpeaker | Sets the default audio route:
|
|
pure virtual |
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.
speakerOn | Sets whether to route the audio to the speakerphone or earpiece:
|
|
pure virtual |
Enables in-ear monitoring (for Android and iOS only).
enabled | Determines whether to enable in-ear monitoring.
|
|
pure virtual |
Sets the volume of the in-ear monitor.
volume | Sets the volume of the in-ear monitor. The value ranges between 0 and 100 (default). |
|
pure virtual |
Checks whether the speakerphone is enabled.
|
pure virtual |
Sets the 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. |
|
pure virtual |
Enables loopback recording.
If you enable loopback recording, the output of the sound card is mixed into the audio stream sent to the other end.
enabled | Sets whether to enable/disable loopback recording.
|
deviceName | Pointer to the device name of the sound card. The default value is NULL (the default sound card). |
|
pure virtual |
Shares the whole or part of a screen by specifying the display ID.
displayId | The display ID of the screen to be shared. This parameter specifies which screen you want to share. |
regionRect | (Optional) Sets the relative location of the region to the screen. NIL means sharing the whole screen. See Rectangle. If the specified region overruns the screen, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen. |
captureParams | Sets the screen sharing encoding parameters. See ScreenCaptureParameters. |
|
pure virtual |
Shares the whole or part of a screen by specifying the screen rect.
screenRect | Sets the relative location of the screen to the virtual screen. For information on how to get screenRect, see the Advanced Guide Share the Screen. |
regionRect | (Optional) Sets the relative location of the region to the screen. NULL means sharing the whole screen. See Rectangle. If the specified region overruns the screen, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen. |
captureParams | Sets the screen sharing encoding parameters. See ScreenCaptureParameters. |
|
pure virtual |
Shares the whole or part of a window by specifying the window ID.
Since v3.0.0, this method supports sharing with common Windows platforms. Agora tests the mainstream Windows applications, 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 | No | ||
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 | |||
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 the Screen. |
regionRect | (Optional) The relative location of the region to the window. NULL/NIL means sharing the whole window. See Rectangle. If the specified region overruns the window, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole window. |
captureParams | Window sharing encoding parameters. See ScreenCaptureParameters. |
|
pure virtual |
Sets the content hint for screen sharing.
A content hint suggests the type of the content being shared, so that the SDK applies different optimization algorithm to different types of content.
contentHint | Sets the content hint for screen sharing. See VideoContentHint. |
|
pure virtual |
Updates the screen sharing parameters.
captureParams | Sets the screen sharing encoding parameters. See ScreenCaptureParameters. |
|
pure virtual |
Updates the screen sharing region.
regionRect | Sets the relative location of the region to the screen or window. NULL means sharing the whole screen or window. See Rectangle. If the specified region overruns the screen or window, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen or window. |
|
pure virtual |
Stop screen sharing.
|
pure virtual |
DEPRECATED Starts screen sharing.
This method is deprecated as of v2.4.0. See the following methods instead:
This method shares the whole screen, specified window, or specified region:
windowId
as 0 and rect
as NULL.windowId
as a value other than 0. Each window has a windowId
that is not 0.windowId
as 0 and rect
not as NULL. In this case, you can share the specified region, for example by dragging the mouse or implementing your own logic.windowId | Sets the screen sharing area. See WindowIDType. |
captureFreq | (Mandatory) The captured frame rate. The value ranges between 1 fps and 15 fps. |
rect | Specifies the screen-sharing region. rect is valid when windowsId is set as 0. When rect is set as NULL, the whole screen is shared. |
bitrate | The captured bitrate. |
|
pure virtual |
DEPRECATED Updates the screen capture region.
rect | Specifies the required region inside the screen or window. |
|
pure virtual |
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.
callId | Pointer to the current call ID. |
|
pure virtual |
Allows a user to rate a call after the call ends.
callId | Pointer to the ID of the call, retrieved from the getCallId method. |
rating | Rating of the call. The value is between 1 (lowest score) and 5 (highest score). If you set a value out of this range, the ERR_INVALID_ARGUMENT (2) error returns. |
description | (Optional) Pointer to the description of the rating, with a string length of less than 800 bytes. |
|
pure virtual |
Allows a user to complain about the call quality after a call ends.
callId | Pointer to the ID of the call, retrieved from the getCallId method. |
description | (Optional) Pointer to the description of the complaint, with a string length of less than 800 bytes. |
|
pure virtual |
Retrieves the SDK version number.
build | Pointer to the build number. |
|
pure virtual |
Enables the network connection quality test.
This method tests the quality of the users' network connections and is disabled by default.
Before a user joins a channel or before an audience switches to a host, call this method to check the uplink network quality.
This method consumes additional network traffic, and hence may affect communication quality.
Call the disableLastmileTest method to disable this test after receiving the onLastmileQuality callback, and before joining a channel.
disableLastmileTest
method or not, the SDK automatically stops consuming the bandwidth.
|
pure virtual |
Disables the network connection quality test.
|
pure virtual |
Starts the last-mile network probe test.
This method starts the last-mile network probe test before joining a channel to get the uplink and downlink last-mile network statistics, including the bandwidth, packet loss, jitter, and round-trip time (RTT).
Call this method to check the uplink network quality before users join a channel or before an audience switches to a host. Once this method is enabled, the SDK returns the following callbacks:
config | Sets the configurations of the last-mile network probe test. See LastmileProbeConfig. |
|
pure virtual |
Stops the last-mile network probe test.
|
pure virtual |
Retrieves the warning or error description.
|
pure virtual |
Enables built-in encryption with an encryption password before users join a channel.
All users in a channel must use the same encryption password. The encryption password is automatically cleared once a user leaves the channel.
If an encryption password is not specified, the encryption functionality will be disabled.
secret | Pointer to the encryption password. |
|
pure virtual |
Sets the built-in encryption mode.
The Agora SDK supports built-in encryption, which is set to the aes-128-xts
mode by default. Call this method to use other encryption modes.
All users in the same channel must use the same encryption mode and password.
Refer to the information related to the AES encryption algorithm on the differences between the encryption modes.
encryptionMode | Pointer to the set encryption mode:
|
|
pure virtual |
Registers a packet observer.
The Agora SDK allows your application to register a packet observer to receive callbacks for voice or video packet transmission.
observer | Pointer to the registered packet observer. See IPacketObserver. |
|
pure virtual |
Creates a data stream.
Each user can create up to five data streams during the lifecycle of the IRtcEngine.
reliable
and ordered
parameters to true or false. Do not set one as true and the other as false.streamId | Pointer to the ID of the created data stream. |
reliable | Sets whether or not the recipients are guaranteed to receive the data stream from the sender within five seconds:
|
ordered | Sets whether or not the recipients receive the data stream in the sent order:
|
|
pure virtual |
Sends data stream messages to all users in a channel.
The SDK has the following restrictions on this method:
A successful sendStreamMessage method call triggers the onStreamMessage callback on the remote client, from which the remote user gets the stream message.
A failed sendStreamMessage method call triggers the onStreamMessage callback on the remote client.
streamId | ID of the sent data stream, returned in the createDataStream method. |
data | Pointer to the sent data. |
length | Length of the sent data. |
|
pure virtual |
Publishes the local stream to a specified CDN live RTMP address. (CDN live only.)
The SDK returns the result of this method call in the onStreamPublished callback.
The addPublishStreamUrl method call triggers the onRtmpStreamingStateChanged callback on the local client to report the state of adding a local stream to the CDN.
url | The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. The RTMP URL address must not contain special characters, such as Chinese language characters. |
transcodingEnabled | Sets whether transcoding is enabled/disabled:
|
|
pure virtual |
Removes an RTMP stream from the CDN. (CDN live only.)
This method removes the RTMP URL address (added by the addPublishStreamUrl method) from a CDN live stream. The SDK returns the result of this method call in the onStreamUnpublished callback.
The removePublishStreamUrl method call triggers the onRtmpStreamingStateChanged callback on the local client to report the state of removing an RTMP stream from the CDN.
url | The RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes. |
|
pure virtual |
Sets the video layout and audio settings for CDN live. (CDN live only.)
The SDK triggers the onTranscodingUpdated callback when you call the setLiveTranscoding
method to update the transcoding setting.
setLiveTranscoding
method to update the transcoding setting for the first time, the SDK does not trigger the onTranscodingUpdated
callback.transcoding | Sets the CDN live audio/video transcoding settings. See LiveTranscoding. |
|
pure virtual |
DEPRECATED Adds a watermark image to the local video or CDN live stream.
This method is deprecated from v2.9.1. Use addVideoWatermark2 instead.
This method adds a PNG watermark image to the local video stream for the recording device, channel audience, and CDN live audience to view and capture.
To add the PNG file to the CDN live publishing stream, see the setLiveTranscoding method.
watermark | Pointer to the watermark image to be added to the local video stream. See RtcImage. |
|
pure virtual |
Adds a watermark image to the local video.
This method adds a PNG watermark image to the local video in a live broadcast. Once the watermark image is added, all the audience in the channel (CDN audience included), and the recording device can see and capture it. Agora supports adding only one watermark image onto the local video, and the newly watermark image replaces the previous one.
The watermark position depends on the settings in the setVideoEncoderConfiguration method:
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. |
options | Pointer to the watermark's options to be added. See WatermarkOptions for more infomation. |
|
pure virtual |
Removes the watermark image from the video stream added by the addVideoWatermark method.
|
pure virtual |
Enables/Disables image enhancement and sets the options.
enabled | Sets whether or not to enable image enhancement:
|
options | Sets the image enhancement option. See BeautyOptions. |
|
pure virtual |
Adds a voice or video stream URL address to a live broadcast.
The onStreamPublished callback returns the inject status. If this method call is successful, the server pulls the voice or video stream and injects it into a live channel. This is applicable to scenarios where all audience members in the channel can watch a live show and interact with each other.
The addInjectStreamUrl method call triggers the following callbacks:
The remote client:
url | Pointer to the URL address to be added to the ongoing live broadcast. Valid protocols are RTMP, HLS, and HTTP-FLV.
|
config | Pointer to the InjectStreamConfig object that contains the configuration of the added voice or video stream. |
|
pure virtual |
Starts to relay media streams across channels.
After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged and onChannelMediaRelayEvent callbacks, and these callbacks return the state and events of the media stream relay.
configuration | The configuration of the media stream relay: ChannelMediaRelayConfiguration. |
|
pure virtual |
Updates the channels for media stream relay. After a successful startChannelMediaRelay method call, if you want to relay the media stream to more channels, or leave the current relay channel, you can call the updateChannelMediaRelay method.
After a successful method call, the SDK triggers the onChannelMediaRelayEvent callback with the RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL (7) state code.
configuration | The media stream relay configuration: ChannelMediaRelayConfiguration. |
|
pure virtual |
Stops the media stream relay.
Once the relay stops, the broadcaster quits all the destination channels.
After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged callback. If the callback returns RELAY_STATE_IDLE (0) and RELAY_OK (0), the broadcaster successfully stops the relay.
|
pure virtual |
Removes the voice or video stream URL address from a live broadcast.
This method removes the URL address (added by the addInjectStreamUrl method) from the live broadcast.
url | Pointer to the URL address of the added stream to be removed. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Gets the current connection state of the SDK.
|
pure virtual |
Registers the metadata observer.
Registers the metadata observer. You need to implement the IMetadataObserver class and specify the metadata type in this method. A successful call of this method triggers the getMaxMetadataSize callback. This method enables you to add synchronized metadata in the video stream for more diversified live broadcast interactions, such as sending shopping links, digital coupons, and online quizzes.
observer | The IMetadataObserver class. See the definition of IMetadataObserver for details. |
type | See METADATA_TYPE. The SDK supports VIDEO_METADATA (0) only for now. |
|
pure virtual |
Provides technical preview functionalities or special customizations by configuring the SDK with JSON options.
The JSON options are not public by default. Agora is working on making commonly used JSON options public in a standard way.
parameters | Sets the parameter as a JSON string in the specified format. |