|
Agora RTC Objective-C API Reference
Refactor
|
Inherits IEngineBase.
Inherited by IRtcEngineEx.
Public Member Functions | |
| virtual int | initialize (const RtcEngineContext &context)=0 |
| virtual int | queryInterface (INTERFACE_ID_TYPE iid, void **inter)=0 |
| virtual const char * | getVersion (int *build)=0 |
| virtual const char * | getErrorDescription (int code)=0 |
| virtual int | queryCodecCapability (CodecCapInfo *codecInfo, int &size)=0 |
| virtual int | queryDeviceScore ()=0 |
| virtual int | preloadChannel (const char *token, const char *channelId, uid_t uid)=0 |
| virtual int | preloadChannelWithUserAccount (const char *token, const char *channelId, const char *userAccount)=0 |
| virtual int | updatePreloadChannelToken (const char *token)=0 |
| virtual int | joinChannel (const char *token, const char *channelId, const char *info, uid_t uid)=0 |
| virtual int | joinChannel (const char *token, const char *channelId, uid_t uid, const ChannelMediaOptions &options)=0 |
| virtual int | updateChannelMediaOptions (const ChannelMediaOptions &options)=0 |
| virtual int | leaveChannel ()=0 |
| virtual int | leaveChannel (const LeaveChannelOptions &options)=0 |
| virtual int | renewToken (const char *token)=0 |
| virtual int | setChannelProfile (CHANNEL_PROFILE_TYPE profile)=0 |
| virtual int | setClientRole (CLIENT_ROLE_TYPE role)=0 |
| virtual int | setClientRole (CLIENT_ROLE_TYPE role, const ClientRoleOptions &options)=0 |
| virtual int | startEchoTest (const EchoTestConfiguration &config)=0 |
| virtual int | enableVideo ()=0 |
| virtual int | disableVideo ()=0 |
| virtual int | startPreview ()=0 |
| virtual int | startPreview (VIDEO_SOURCE_TYPE sourceType)=0 |
| virtual int | stopPreview ()=0 |
| virtual int | stopPreview (VIDEO_SOURCE_TYPE sourceType)=0 |
| virtual int | startLastmileProbeTest (const LastmileProbeConfig &config)=0 |
| virtual int | stopLastmileProbeTest ()=0 |
| virtual int | setVideoEncoderConfiguration (const VideoEncoderConfiguration &config)=0 |
| virtual int | setFaceShapeBeautyOptions (bool enabled, const FaceShapeBeautyOptions &options, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0 |
| virtual int | setFaceShapeAreaOptions (const FaceShapeAreaOptions &options, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0 |
| virtual int | getFaceShapeBeautyOptions (FaceShapeBeautyOptions &options, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0 |
| virtual int | getFaceShapeAreaOptions (agora::rtc::FaceShapeAreaOptions::FACE_SHAPE_AREA shapeArea, FaceShapeAreaOptions &options, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0 |
| virtual int | setLowlightEnhanceOptions (bool enabled, const LowlightEnhanceOptions &options, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0 |
| virtual int | setVideoDenoiserOptions (bool enabled, const VideoDenoiserOptions &options, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0 |
| virtual int | setColorEnhanceOptions (bool enabled, const ColorEnhanceOptions &options, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0 |
| virtual int | enableVirtualBackground (bool enabled, VirtualBackgroundSource backgroundSource, SegmentationProperty segproperty, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0 |
| virtual int | setupRemoteVideo (const VideoCanvas &canvas)=0 |
| virtual int | setupLocalVideo (const VideoCanvas &canvas)=0 |
| virtual int | setVideoScenario (VIDEO_APPLICATION_SCENARIO_TYPE scenarioType)=0 |
| virtual int | setVideoQoEPreference (VIDEO_QOE_PREFERENCE_TYPE qoePreference)=0 |
| virtual int | enableAudio ()=0 |
| virtual int | disableAudio ()=0 |
| virtual int | setAudioProfile (AUDIO_PROFILE_TYPE profile, AUDIO_SCENARIO_TYPE scenario) 1=0 |
| virtual int | setAudioProfile (AUDIO_PROFILE_TYPE profile)=0 |
| virtual int | setAudioScenario (AUDIO_SCENARIO_TYPE scenario)=0 |
| virtual int | enableLocalAudio (bool enabled)=0 |
| virtual int | muteLocalAudioStream (bool mute)=0 |
| virtual int | muteAllRemoteAudioStreams (bool mute)=0 |
| virtual int | muteRemoteAudioStream (uid_t uid, bool mute)=0 |
| virtual int | muteLocalVideoStream (bool mute)=0 |
| virtual int | enableLocalVideo (bool enabled)=0 |
| virtual int | muteAllRemoteVideoStreams (bool mute)=0 |
| virtual int | setRemoteDefaultVideoStreamType (VIDEO_STREAM_TYPE streamType)=0 |
| virtual int | muteRemoteVideoStream (uid_t uid, bool mute)=0 |
| virtual int | setRemoteVideoStreamType (uid_t uid, VIDEO_STREAM_TYPE streamType)=0 |
| virtual int | setRemoteVideoSubscriptionOptions (uid_t uid, const VideoSubscriptionOptions &options)=0 |
| virtual int | setSubscribeAudioAllowlist (uid_t *uidList, int uidNumber)=0 |
| virtual int | setSubscribeVideoAllowlist (uid_t *uidList, int uidNumber)=0 |
| virtual int | enableAudioVolumeIndication (int interval, int smooth, bool reportVad)=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 | startAudioRecording (const AudioRecordingConfiguration &config)=0 |
| virtual int | registerAudioEncodedFrameObserver (const AudioEncodedFrameObserverConfig &config, IAudioEncodedFrameObserver *observer)=0 |
| virtual agora_refptr< IMediaPlayer > | createMediaPlayer ()=0 |
| virtual int | destroyMediaPlayer (agora_refptr< IMediaPlayer > media_player)=0 |
| virtual agora_refptr< IMediaRecorder > | createMediaRecorder (const RecorderStreamInfo &info)=0 |
| virtual int | destroyMediaRecorder (agora_refptr< IMediaRecorder > mediaRecorder)=0 |
| virtual int | selectAudioTrack (int index)=0 |
| virtual int | getAudioTrackCount ()=0 |
| virtual int | enableSoundPositionIndication (bool enabled)=0 |
| virtual int | setRemoteVoicePosition (uid_t uid, double pan, double gain)=0 |
| virtual int | enableSpatialAudio (bool enabled)=0 |
| virtual int | setVoiceBeautifierPreset (VOICE_BEAUTIFIER_PRESET preset)=0 |
| virtual int | setVoiceConversionPreset (VOICE_CONVERSION_PRESET preset)=0 |
| virtual int | setVoiceBeautifierParameters (VOICE_BEAUTIFIER_PRESET preset, int param1, int param2)=0 |
| virtual int | setVoiceConversionParameters (VOICE_CONVERSION_PRESET preset, int param1, int param2)=0 |
| virtual int | setHeadphoneEQPreset (HEADPHONE_EQUALIZER_PRESET preset)=0 |
| virtual int | setHeadphoneEQParameters (int lowGain, int highGain)=0 |
| virtual int | enableVoiceAITuner (bool enabled, VOICE_AI_TUNER_TYPE type)=0 |
| virtual int | setLogFile (const char *filePath)=0 |
| virtual int | setLogFilter (unsigned int filter)=0 |
| virtual int | setLogLevel (commons::LOG_LEVEL level)=0 |
| virtual int | setLogFileSize (unsigned int fileSizeInKBytes)=0 |
| virtual int | uploadLogFile (agora::util::AString &requestId)=0 |
| virtual int | writeLog (commons::LOG_LEVEL level, const char *fmt,...)=0 |
| virtual int | setLocalRenderMode (media::base::RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode)=0 |
| virtual int | setRemoteRenderMode (uid_t uid, media::base::RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode)=0 |
| virtual int | setLocalRenderTargetFps (VIDEO_SOURCE_TYPE sourceType, int targetFps)=0 |
| virtual int | setRemoteRenderTargetFps (int targetFps)=0 |
| virtual int | setLocalRenderMode (media::base::RENDER_MODE_TYPE renderMode) 1=0 |
| virtual int | setLocalVideoMirrorMode (VIDEO_MIRROR_MODE_TYPE mirrorMode) 1=0 |
| virtual int | enableDualStreamMode (bool enabled) 1=0 |
| virtual int | enableDualStreamMode (bool enabled, const SimulcastStreamConfig &streamConfig) 1=0 |
| virtual int | setDualStreamMode (SIMULCAST_STREAM_MODE mode)=0 |
| virtual int | setSimulcastConfig (const SimulcastConfig &simulcastConfig)=0 |
| virtual int | setDualStreamMode (SIMULCAST_STREAM_MODE mode, const SimulcastStreamConfig &streamConfig)=0 |
| virtual int | enableCustomAudioLocalPlayback (track_id_t trackId, bool enabled)=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 channel, int samplesPerCall)=0 |
| virtual int | setEarMonitoringAudioFrameParameters (int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall)=0 |
| virtual int | setPlaybackAudioFrameBeforeMixingParameters (int sampleRate, int channel)=0 |
| virtual int | setPlaybackAudioFrameBeforeMixingParameters (int sampleRate, int channel, int samplesPerCall)=0 |
| virtual int | enableAudioSpectrumMonitor (int intervalInMS=100)=0 |
| virtual int | disableAudioSpectrumMonitor ()=0 |
| virtual int | registerAudioSpectrumObserver (agora::media::IAudioSpectrumObserver *observer)=0 |
| virtual int | unregisterAudioSpectrumObserver (agora::media::IAudioSpectrumObserver *observer)=0 |
| virtual int | adjustRecordingSignalVolume (int volume)=0 |
| virtual int | muteRecordingSignal (bool mute)=0 |
| virtual int | adjustPlaybackSignalVolume (int volume)=0 |
| virtual int | adjustUserPlaybackSignalVolume (uid_t uid, int volume)=0 |
| virtual int | setRemoteSubscribeFallbackOption (STREAM_FALLBACK_OPTIONS option)=0 |
| virtual int | setHighPriorityUserList (uid_t *uidList, int uidNum, STREAM_FALLBACK_OPTIONS option)=0 |
| virtual int | enableExtension (const char *provider, const char *extension, const ExtensionInfo &extensionInfo, bool enable=true)=0 |
| virtual int | setExtensionProperty (const char *provider, const char *extension, const ExtensionInfo &extensionInfo, const char *key, const char *value)=0 |
| virtual int | getExtensionProperty (const char *provider, const char *extension, const ExtensionInfo &extensionInfo, const char *key, char *value, int buf_len)=0 |
| virtual int | enableLoopbackRecording (bool enabled, const char *deviceName=NULL)=0 |
| virtual int | adjustLoopbackSignalVolume (int volume)=0 |
| virtual int | getLoopbackRecordingVolume ()=0 |
| virtual int | enableInEarMonitoring (bool enabled, int includeAudioFilters)=0 |
| virtual int | setInEarMonitoringVolume (int volume)=0 |
| virtual int | setExtensionProviderProperty (const char *provider, const char *key, const char *value)=0 |
| virtual int | registerExtension (const char *provider, const char *extension, agora::media::MEDIA_SOURCE_TYPE type=agora::media::UNKNOWN_MEDIA_SOURCE)=0 |
| virtual int | enableExtension (const char *provider, const char *extension, bool enable=true, agora::media::MEDIA_SOURCE_TYPE type=agora::media::UNKNOWN_MEDIA_SOURCE)=0 |
| virtual int | setExtensionProperty (const char *provider, const char *extension, const char *key, const char *value, agora::media::MEDIA_SOURCE_TYPE type=agora::media::UNKNOWN_MEDIA_SOURCE)=0 |
| virtual int | getExtensionProperty (const char *provider, const char *extension, const char *key, char *value, int buf_len, agora::media::MEDIA_SOURCE_TYPE type=agora::media::UNKNOWN_MEDIA_SOURCE)=0 |
| virtual video_track_id_t | createCustomVideoTrack ()=0 |
| virtual video_track_id_t | createCustomEncodedVideoTrack (const SenderOptions &sender_option)=0 |
| virtual int | destroyCustomVideoTrack (video_track_id_t video_track_id)=0 |
| virtual int | destroyCustomEncodedVideoTrack (video_track_id_t video_track_id)=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 int | startRtmpStreamWithoutTranscoding (const char *url)=0 |
| virtual int | startRtmpStreamWithTranscoding (const char *url, const LiveTranscoding &transcoding)=0 |
| virtual int | updateRtmpTranscoding (const LiveTranscoding &transcoding)=0 |
| virtual int | startLocalVideoTranscoder (const LocalTranscoderConfiguration &config)=0 |
| virtual int | updateLocalTranscoderConfiguration (const LocalTranscoderConfiguration &config)=0 |
| virtual int | stopRtmpStream (const char *url)=0 |
| virtual int | stopLocalVideoTranscoder ()=0 |
| virtual int | startLocalAudioMixer (const LocalAudioMixerConfiguration &config)=0 |
| virtual int | updateLocalAudioMixerConfiguration (const LocalAudioMixerConfiguration &config)=0 |
| virtual int | stopLocalAudioMixer ()=0 |
| virtual int | startCameraCapture (VIDEO_SOURCE_TYPE sourceType, const CameraCapturerConfiguration &config)=0 |
| virtual int | stopCameraCapture (VIDEO_SOURCE_TYPE sourceType)=0 |
| virtual int | setScreenCaptureOrientation (VIDEO_SOURCE_TYPE type, VIDEO_ORIENTATION orientation)=0 |
| virtual int | startScreenCapture (VIDEO_SOURCE_TYPE sourceType, const ScreenCaptureConfiguration &config)=0 |
| virtual int | stopScreenCapture (VIDEO_SOURCE_TYPE sourceType)=0 |
| virtual CONNECTION_STATE_TYPE | getConnectionState ()=0 |
| virtual int | registerPacketObserver (IPacketObserver *observer)=0 |
| virtual int | enableEncryption (bool enabled, const EncryptionConfig &config)=0 |
| virtual int | createDataStream (int *streamId, bool reliable, bool ordered)=0 |
| virtual int | createDataStream (int *streamId, const DataStreamConfig &config)=0 |
| virtual int | sendStreamMessage (int streamId, const char *data, size_t length)=0 |
| virtual int | sendRdtMessage (uid_t uid, RdtStreamType type, const char *data, size_t length)=0 |
| virtual int | sendMediaControlMessage (uid_t uid, const char *data, size_t length)=0 |
| virtual int | addVideoWatermark (const RtcImage &watermark) 1=0 |
| virtual int | addVideoWatermark (const char *watermarkUrl, const WatermarkOptions &options)=0 |
| virtual int | addVideoWatermark (const WatermarkConfig &configs)=0 |
| virtual int | removeVideoWatermark (const char *id)=0 |
| virtual int | enableWebSdkInteroperability (bool enabled) 1=0 |
| virtual int | sendCustomReportMessage (const char *id, const char *category, const char *event, const char *label, int value)=0 |
| virtual int | registerMediaMetadataObserver (IMetadataObserver *observer, IMetadataObserver::METADATA_TYPE type)=0 |
| virtual int | unregisterMediaMetadataObserver (IMetadataObserver *observer, IMetadataObserver::METADATA_TYPE type)=0 |
| virtual int | startAudioFrameDump (const char *channel_id, uid_t uid, const char *location, const char *uuid, const char *passwd, long duration_ms, bool auto_upload)=0 |
| virtual int | stopAudioFrameDump (const char *channel_id, uid_t uid, const char *location)=0 |
| virtual int | setAINSMode (bool enabled, AUDIO_AINS_MODE mode)=0 |
| virtual int | registerLocalUserAccount (const char *appId, const char *userAccount)=0 |
| virtual int | joinChannelWithUserAccount (const char *token, const char *channelId, const char *userAccount)=0 |
| virtual int | joinChannelWithUserAccount (const char *token, const char *channelId, const char *userAccount, const ChannelMediaOptions &options)=0 |
| virtual int | joinChannelWithUserAccountEx (const char *token, const char *channelId, const char *userAccount, const ChannelMediaOptions &options, IRtcEngineEventHandler *eventHandler)=0 |
| virtual int | getUserInfoByUserAccount (const char *userAccount, rtc::UserInfo *userInfo)=0 |
| virtual int | getUserInfoByUid (uid_t uid, rtc::UserInfo *userInfo)=0 |
| virtual int | startOrUpdateChannelMediaRelay (const ChannelMediaRelayConfiguration &configuration)=0 |
| virtual int | stopChannelMediaRelay ()=0 |
| virtual int | pauseAllChannelMediaRelay ()=0 |
| virtual int | resumeAllChannelMediaRelay ()=0 |
| virtual int | setDirectCdnStreamingAudioConfiguration (AUDIO_PROFILE_TYPE profile)=0 |
| virtual int | setDirectCdnStreamingVideoConfiguration (const VideoEncoderConfiguration &config)=0 |
| virtual int | startDirectCdnStreaming (IDirectCdnStreamingEventHandler *eventHandler, const char *publishUrl, const DirectCdnStreamingMediaOptions &options)=0 |
| virtual int | stopDirectCdnStreaming ()=0 |
| virtual int | updateDirectCdnStreamingMediaOptions (const DirectCdnStreamingMediaOptions &options)=0 |
| virtual int | startRhythmPlayer (const char *sound1, const char *sound2, const AgoraRhythmPlayerConfig &config)=0 |
| virtual int | stopRhythmPlayer ()=0 |
| virtual int | configRhythmPlayer (const AgoraRhythmPlayerConfig &config)=0 |
| virtual int | takeSnapshot (uid_t uid, const char *filePath)=0 |
| virtual int | takeSnapshot (uid_t uid, const media::SnapshotConfig &config)=0 |
| virtual int | enableContentInspect (bool enabled, const media::ContentInspectConfig &config)=0 |
| virtual int | adjustCustomAudioPublishVolume (track_id_t trackId, int volume)=0 |
| virtual int | adjustCustomAudioPlayoutVolume (track_id_t trackId, int volume)=0 |
| virtual int | setCloudProxy (CLOUD_PROXY_TYPE proxyType)=0 |
| virtual int | setLocalAccessPoint (const LocalAccessPointConfiguration &config)=0 |
| virtual int | setAdvancedAudioOptions (AdvancedAudioOptions &options, int sourceType=0)=0 |
| virtual int | setAVSyncSource (const char *channelId, uid_t uid)=0 |
| virtual int | enableVideoImageSource (bool enable, const ImageTrackOptions &options)=0 |
| virtual int64_t | getCurrentMonotonicTimeInMs ()=0 |
| virtual int | getNetworkType ()=0 |
| virtual int | setParameters (const char *parameters)=0 |
| virtual int | startMediaRenderingTracing ()=0 |
| virtual int | enableInstantMediaRendering ()=0 |
| virtual uint64_t | getNtpWallTimeInMs ()=0 |
| virtual bool | isFeatureAvailableOnDevice (FeatureType type)=0 |
| virtual int | sendAudioMetadata (const char *metadata, size_t length)=0 |
| virtual int | queryHDRCapability (VIDEO_MODULE_TYPE videoModule, HDR_CAPABILITY &capability)=0 |
Static Public Member Functions | |
| static AGORA_CPP_API void | release (RtcEngineReleaseCallback callback=nullptr) |
The IRtcEngine class, which is the basic interface of the Agora SDK that implements the core functions of real-time communication.
IRtcEngine provides the main methods that your app can call.
|
static |
Releases the IRtcEngine instance.
This method releases all resources used by the Agora 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. After a successful method call, you can no longer use any method or callback in the SDK anymore. If you want to use the real-time communication functions again, you must call createAgoraRtcEngine and initialize to create a new IRtcEngine instance.
release in any callback of the SDK. Otherwise, the SDK cannot release the resources until the callbacks return results, which may result in a deadlock.| callback | (Optional) Callback function pointer for setting the destruction mode of the engine to either synchronous or asynchronous. See RtcEngineReleaseCallback.
|
|
pure virtual |
Initializes IRtcEngine.
Call timing: Before calling other APIs, you must call createAgoraRtcEngine and initialize to create and initialize the IRtcEngine object.
IRtcEngine instance for an app. All called methods provided by the IRtcEngine class are executed asynchronously. Agora recommends calling these methods in the same thread.| context | Configurations for the IRtcEngine instance. See RtcEngineContext. |
|
pure virtual |
Gets the pointer to the specified interface.
| iid | The ID of the interface. See INTERFACE_ID_TYPE. |
| inter | An output parameter. The pointer to the specified interface. |
Implements IEngineBase.
|
pure virtual |
Gets the SDK version.
| build | The SDK build index. |
|
pure virtual |
Gets the warning or error description.
| code | The error code reported by the SDK. |
|
pure virtual |
Queries the video codec capabilities of the SDK.
| codecInfo | Input and output parameter. An array representing the video codec capabilities of the SDK. See CodecCapInfo.
|
| size | Input and output parameter, represent the size of the CodecCapInfo array.
|
|
pure virtual |
Queries device score.
Applicable scenarios: In high-definition or ultra-high-definition video scenarios, you can first call this method to query the device's score. If the returned score is low (for example, below 60), you need to lower the video resolution to avoid affecting the video experience. The minimum device score required for different business scenarios is varied. For specific score recommendations, please technical support.
|
pure virtual |
Preloads a channel with token, channelId, and uid.
When audience members need to switch between different channels frequently, calling the method can help shortening the time of joining a channel, thus reducing the time it takes for audience members to hear and see the host. If you join a preloaded channel, leave it and want to rejoin the same channel, you do not need to call this method unless the token for preloading the channel expires. Call timing: To improve the user experience of preloading channels, Agora recommends that before joining the channel, calling this method as early as possible once confirming the channel name and user information.
AUDIO_SCENARIO_CHORUS, otherwise, this method does not take effect.IRtcEngine instance supports preloading 20 channels at most. When exceeding this limit, the latest 20 preloaded channels take effect. Failing to preload a channel does not mean that you can't join a channel, nor will it increase the time of joining a channel.| token | The token generated on your server for authentication. See .When the token for preloading channels expires, you can update the token based on the number of channels you preload.
|
| channelId | The channel name that you want to preload. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters (89 characters in total):
|
| uid | The user ID. This parameter is used to identify the user in the channel for real-time audio and video interaction. You need to set and manage user IDs yourself, and ensure that each user ID in the same channel is unique. This parameter is a 32-bit unsigned integer. The value range is 1 to 2^32-1. If the user ID is not assigned (or set to 0), the SDK assigns a random user ID and onJoinChannelSuccess returns it in the callback. Your application must record and maintain the returned user ID, because the SDK does not do so. |
IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
pure virtual |
Preloads a channel with token, channelId, and userAccount.
When audience members need to switch between different channels frequently, calling the method can help shortening the time of joining a channel, thus reducing the time it takes for audience members to hear and see the host. If you join a preloaded channel, leave it and want to rejoin the same channel, you do not need to call this method unless the token for preloading the channel expires. Call timing: To improve the user experience of preloading channels, Agora recommends that before joining the channel, calling this method as early as possible once confirming the channel name and user information.
AUDIO_SCENARIO_CHORUS, otherwise, this method does not take effect.IRtcEngine instance supports preloading 20 channels at most. When exceeding this limit, the latest 20 preloaded channels take effect. Failing to preload a channel does not mean that you can't join a channel, nor will it increase the time of joining a channel.| token | The token generated on your server for authentication. See .When the token for preloading channels expires, you can update the token based on the number of channels you preload.
|
| channelId | The channel name that you want to preload. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters (89 characters in total):
|
| userAccount | The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as NULL. Supported characters are as follows(89 in total):
|
IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
pure virtual |
Updates the wildcard token for preloading channels.
You need to maintain the life cycle of the wildcard token by yourself. When the token expires, you need to generate a new wildcard token and then call this method to pass in the new token. Applicable scenarios: In scenarios involving multiple channels, such as switching between different channels, using a wildcard token means users do not need to apply for a new token every time joinning a new channel, which can save users time for switching channels and reduce the pressure on your token server.
| token | The new token. |
IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
pure virtual |
Joins a channel.
By default, the user subscribes to the audio and video streams of all the other users in the channel, giving rise to usage and billings. To stop subscribing to a specified stream or all remote streams, call the corresponding mute methods. Call timing: Call this method after initialize. Related callbacks: A successful call of this method triggers the following callbacks:
onJoinChannelSuccess and onConnectionStateChanged callbacks.onUserJoined callback, if a user joining the channel in the COMMUNICATION profile, or a host joining a channel in the LIVE_BROADCASTING profile. When the connection between the local 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.initialize method; otherwise, you may fail to join the channel with the token.| token | The token generated on your server for authentication. See .Note:
|
| channelId | The channel name. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters (89 characters in total):
|
| info | (Optional) Reserved for future use. |
| uid | The user ID. This parameter is used to identify the user in the channel for real-time audio and video interaction. You need to set and manage user IDs yourself, and ensure that each user ID in the same channel is unique. This parameter is a 32-bit unsigned integer. The value range is 1 to 2^32-1. If the user ID is not assigned (or set to 0), the SDK assigns a random user ID and onJoinChannelSuccess returns it in the callback. Your application must record and maintain the returned user ID, because the SDK does not do so. |
uid parameter is not set to an integer, or the value of a member in ChannelMediaOptions is invalid. You need to pass in a valid parameter and join the channel again.IRtcEngine object. You need to reinitialize the IRtcEngine object.IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.IRtcEngine object is wrong. The typical cause is that after calling startEchoTest to start a call loop test, you call this method to join the channel without calling stopEchoTest to stop the test. You need to call stopEchoTest before calling this method.onConnectionStateChanged callback to see whether the user is in the channel. Do not call this method to join the channel unless you receive the CONNECTION_STATE_DISCONNECTED (1) state.channelId to rejoin the channel.uid to rejoin the channel.
|
pure virtual |
Joins a channel with media options.
Compared to joinChannel(const char* token, const char* channelId, const char* info, uid_t uid), this method has the options parameter which is used to set media options, such as whether to publish audio and video streams within a channel, or whether to automatically subscribe to the audio and video streams of all remote users when joining a channel. By default, the user subscribes to the audio and video streams of all the other users in the channel, giving rise to usage and billings. To stop subscribing to other streams, set the options parameter or call the corresponding mute methods. Call timing: Call this method after initialize. Related callbacks: A successful call of this method triggers the following callbacks:
onJoinChannelSuccess and onConnectionStateChanged callbacks.onUserJoined callback, if a user joining the channel in the COMMUNICATION profile, or a host joining a channel in the LIVE_BROADCASTING profile. When the connection between the local 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.initialize method; otherwise, you may fail to join the channel with the token.| token | The token generated on your server for authentication. See .Note:
|
| channelId | The channel name. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters (89 characters in total):
|
| uid | The user ID. This parameter is used to identify the user in the channel for real-time audio and video interaction. You need to set and manage user IDs yourself, and ensure that each user ID in the same channel is unique. This parameter is a 32-bit unsigned integer. The value range is 1 to 2^32-1. If the user ID is not assigned (or set to 0), the SDK assigns a random user ID and onJoinChannelSuccess returns it in the callback. Your application must record and maintain the returned user ID, because the SDK does not do so. |
| options | The channel media options. See ChannelMediaOptions. |
uid parameter is not set to an integer, or the value of a member in ChannelMediaOptions is invalid. You need to pass in a valid parameter and join the channel again.IRtcEngine object. You need to reinitialize the IRtcEngine object.IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.IRtcEngine object is wrong. The typical cause is that after calling startEchoTest to start a call loop test, you call this method to join the channel without calling stopEchoTest to stop the test. You need to call stopEchoTest before calling this method.onConnectionStateChanged callback to see whether the user is in the channel. Do not call this method to join the channel unless you receive the CONNECTION_STATE_DISCONNECTED (1) state.channelId to rejoin the channel.uid to rejoin the channel.
|
pure virtual |
Updates the channel media options after joining the channel.
| options | The channel media options. See ChannelMediaOptions. |
ChannelMediaOptions is invalid. For example, the token or the user ID is invalid. You need to fill in a valid parameter.IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.IRtcEngine object is wrong. The possible reason is that the user is not in the channel. Agora recommends that you use the onConnectionStateChanged callback to see whether the user is in the channel. If you receive the CONNECTION_STATE_DISCONNECTED (1) or CONNECTION_STATE_FAILED (5) state, the user is not in the channel. You need to call joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options) to join a channel before calling this method.
|
pure virtual |
Leaves a channel.
After calling this method, the SDK terminates the audio and video interaction, leaves the current channel, and releases all resources related to the session. After joining the channel, you must call this method to end the call; otherwise, the next call cannot be started. Call timing: Call this method after joining a channel. Related callbacks: A successful call of this method triggers the following callbacks:
onLeaveChannel callback will be triggered.onUserOffline callback will be triggered after the remote host leaves the channel.release immediately after calling this method, the SDK does not trigger the onLeaveChannel callback.joinChannelEx to join multiple channels, calling this method will leave all the channels you joined.
|
pure virtual |
Sets channel options and leaves the channel.
After calling this method, the SDK terminates the audio and video interaction, leaves the current channel, and releases all resources related to the session. After joining a channel, you must call this method or leaveChannel() to end the call, otherwise, the next call cannot be started. If you have called joinChannelEx to join multiple channels, calling this method will leave all the channels you joined. Call timing: Call this method after joining a channel. Related callbacks: A successful call of this method triggers the following callbacks:
onLeaveChannel callback will be triggered.onUserOffline callback will be triggered after the remote host leaves the channel.release immediately after calling this method, the SDK does not trigger the onLeaveChannel callback. This method call is asynchronous. When this method returns, it does not necessarily mean that the user has left the channel.| options | The options for leaving the channel. See LeaveChannelOptions. |
|
pure virtual |
Renews the token.
This method is used to update the token. After successfully calling this method, the SDK will trigger the onRenewTokenResult callback. A token will expire after a certain period of time, at which point the SDK will be unable to establish a connection with the server. Call timing: In any of the following cases, Agora recommends that you generate a new token on your server and then call this method to renew your token:
onTokenPrivilegeWillExpire callback reporting the token is about to expire.onRequestToken callback reporting the token has expired.onConnectionStateChanged callback reporting CONNECTION_CHANGED_TOKEN_EXPIRED (9).| token | The new token. |
IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
pure virtual |
Sets the channel profile.
You can call this method to set the channel profile. The SDK adopts different optimization strategies for different channel profiles. For example, in a live streaming scenario, the SDK prioritizes video quality. After initializing the SDK, the default channel profile is the live streaming profile. Call timing: Call this method before joining a channel.
setDefaultAudioRouteToSpeakerphone.| profile | The channel profile. See CHANNEL_PROFILE_TYPE. |
|
pure virtual |
Sets the client role.
By default,the SDK sets the user role as audience. You can call this method to set the user role as host. The user role ( roles ) determines the users' permissions at the SDK level, including whether they can publish audio and video streams in a channel. Call timing: You can call this method either before or after joining a channel. If you call this method to set the user role as the host before joining the channel and set the local video property through the setupLocalVideo method, the local video preview is automatically enabled when the user joins the channel. If you call this method to set the user role after joining a channel, the SDK will automatically call the muteLocalAudioStream and muteLocalVideoStream method to change the state for publishing audio and video streams. Related callbacks: If you call this method to switch the user role after joining the channel, the SDK triggers the following callbacks:
onClientRoleChanged on the local client.Note: Calling this method before joining a channel and set the role to AUDIENCE will trigger this callback as well.onUserJoined or onUserOffline on the remote client. If you call this method to set the user role after joining a channel but encounter a failure, the SDK trigger the onClientRoleChangeFailed callback to report the reason for the failure and the current user role.BROADCASTER, the onClientRoleChanged callback will not be triggered on the local client. Calling this method before joining a channel and set the role to AUDIENCE will trigger this callback as well.| role | The user role. See CLIENT_ROLE_TYPE. Note: If you set the user role as an audience member, you cannot publish audio and video streams in the channel. If you want to publish media streams in a channel during live streaming, ensure you set the user role as broadcaster. |
|
pure virtual |
Sets the user role and the audience latency level in a live streaming scenario.
By default,the SDK sets the user role as audience. You can call this method to set the user role as host. The user role ( roles ) determines the users' permissions at the SDK level, including whether they can publish audio and video streams in a channel. The difference between this method and setClientRole(CLIENT_ROLE_TYPE role) is that, this method supports setting the audienceLatencyLevel. audienceLatencyLevel needs to be used together with role to determine the level of service that users can enjoy within their permissions. For example, an audience member can choose to receive remote streams with low latency or ultra-low latency. Call timing: You can call this method either before or after joining a channel. If you call this method to set the user role as the host before joining the channel and set the local video property through the setupLocalVideo method, the local video preview is automatically enabled when the user joins the channel. If you call this method to set the user role after joining a channel, the SDK will automatically call the muteLocalAudioStream and muteLocalVideoStream method to change the state for publishing audio and video streams. Related callbacks: If you call this method to switch the user role after joining the channel, the SDK triggers the following callbacks:
onClientRoleChanged on the local client.Note: Calling this method before joining a channel and set the role to AUDIENCE will trigger this callback as well.onUserJoined or onUserOffline on the remote client. If you call this method to set the user role after joining a channel but encounter a failure, the SDK trigger the onClientRoleChangeFailed callback to report the reason for the failure and the current user role.role to BROADCASTER, the onClientRoleChanged callback will not be triggered on the local client. Calling this method before joining a channel and set the role to AUDIENCE will trigger this callback as well.| role | The user role. See CLIENT_ROLE_TYPE. Note: If you set the user role as an audience member, you cannot publish audio and video streams in the channel. If you want to publish media streams in a channel during live streaming, ensure you set the user role as broadcaster. |
| options | The detailed options of a user, including the user level. See ClientRoleOptions. |
|
pure virtual |
Starts an audio device loopback test.
To test whether the user's local sending and receiving streams are normal, you can call this method to perform an audio and video call loop test, which tests whether the audio and video devices and the user's upstream and downstream networks are working properly. After starting the test, the user needs to make a sound or face the camera. The audio or video is output after about two seconds. If the audio playback is normal, the audio device and the user's upstream and downstream networks are working properly; if the video playback is normal, the video device and the user's upstream and downstream networks are working properly. Call timing: You can call this method either before or after joining a channel.
stopEchoTest to end the test; otherwise, the user cannot perform the next audio and video call loop test and cannot join the channel.| config | The configuration of the audio and video call loop test. See EchoTestConfiguration. |
|
pure virtual |
Enables the video module.
The video module is disabled by default, call this method to enable it. If you need to disable the video module later, you need to call disableVideo. Call timing: This method can be called either before joining a channel or while in the channel:
onRemoteVideoStateChanged callback on the remote client.enableLocalVideo: Whether to enable the camera to create the local video stream.muteLocalVideoStream: Whether to publish the local video stream.muteRemoteVideoStream: Whether to subscribe to and play the remote video stream.muteAllRemoteVideoStreams: Whether to subscribe to and play all remote video streams.enableLocalVideo, muteRemoteVideoStream, and muteAllRemoteVideoStreams. Proceed it with caution.
|
pure virtual |
Disables the video module.
This method is used to disable the video module. Call timing: This method can be called either before or after joining the channel.
enableVideo can swithch to video mode again. Related callbacks: A successful call of this method triggers the onUserEnableVideo (false) callback on the remote client.enableLocalVideo: Whether to enable the camera to create the local video stream.muteLocalVideoStream: Whether to publish the local video stream.muteRemoteVideoStream: Whether to subscribe to and play the remote video stream.muteAllRemoteVideoStreams: Whether to subscribe to and play all remote video streams.
|
pure virtual |
Enables the local video preview.
You can call this method to enable local video preview. Call timing: This method must be called after enableVideo and setupLocalVideo.
stopPreview() to disable local preview.
|
pure virtual |
Enables the local video preview and specifies the video source for the preview.
This method is used to start local video preview and specify the video source that appears in the preview screen. Call timing: This method must be called after enableVideo and setupLocalVideo.
stopPreview() to disable local preview.| sourceType | The type of the video source. See VIDEO_SOURCE_TYPE. |
|
pure virtual |
Stops the local video preview.
Applicable scenarios: After calling startPreview() to start the preview, if you want to stop the local video preview, call this method. Call timing: Call this method before joining a channel or after leaving a channel.
|
pure virtual |
Stops the local video preview.
Applicable scenarios: After calling startPreview(VIDEO_SOURCE_TYPE sourceType) to start the preview, if you want to stop the local video preview, call this method. Call timing: Call this method before joining a channel or after leaving a channel.
| sourceType | The type of the video source. See VIDEO_SOURCE_TYPE. |
|
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 timing: Do not call other methods before receiving the onLastmileQuality and onLastmileProbeResult callbacks. Otherwise, the callbacks may be interrupted. Related callbacks: After successfully calling this method, the SDK sequentially triggers the following 2 callbacks:
onLastmileQuality: The SDK triggers this callback within two seconds depending on the network conditions. This callback rates the network conditions and is more closely linked to the user experience.onLastmileProbeResult: The SDK triggers this callback within 30 seconds depending on the network conditions. This callback returns the real-time statistics of the network conditions and is more objective.| config | The configurations of the last-mile network probe test. See LastmileProbeConfig. |
|
pure virtual |
Stops the last mile network probe test.
|
pure virtual |
Sets the video encoder configuration.
Sets the encoder configuration for the local video. Each configuration profile corresponds to a set of video parameters, including the resolution, frame rate, and bitrate. Call timing: You can call this method either before or after joining a channel. If the user does not need to reset the video encoding properties after joining the channel, Agora recommends calling this method before enableVideo to reduce the time to render the first video frame.
getMirrorApplied method support setting the mirroring effect. Agora recommends that you only choose one method to set it up. Using both methods at the same time causes the mirroring effect to overlap, and the mirroring settings fail.config specified in this method is the maximum value under ideal network conditions. If the video engine cannot render the video using the specified config due to unreliable network conditions, the parameters further down the list are considered until a successful configuration is found.| config | Video profile. See VideoEncoderConfiguration. |
|
pure virtual |
Sets the face shape options and specifies the media source.
Calling this method allows for modifying various parts of the face, achieving slimming, enlarging eyes, slimming nose, and other minor cosmetic effects all at once using preset parameters, supporting fine-tuning the overall modification intensity. Call timing: Call this method after calling enableVideo.
libagora_clear_vision_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.| enabled | Whether to enable the face shape effect:
|
| options | Face shaping style options, see FaceShapeBeautyOptions. |
| type | The type of the media source to which the filter effect is applied. See MEDIA_SOURCE_TYPE.Attention: In this method, this parameter supports only the following two settings:
|
|
pure virtual |
Sets the image enhancement options for facial areas and specifies the media source.
If the preset beauty effects implemented in the setFaceShapeBeautyOptions method do not meet expectations, you can use this method to set beauty area options, individually fine-tune each part of the face, and achieve a more refined beauty effect. Call timing: Call this method after calling setFaceShapeBeautyOptions.
libagora_clear_vision_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.| options | Facial enhancement areas, see FaceShapeAreaOptions. |
| type | The type of the media source to which the filter effect is applied. See MEDIA_SOURCE_TYPE.Attention: In this method, this parameter supports only the following two settings:
|
|
pure virtual |
Gets the beauty effect options.
Calling this method can retrieve the current settings of the beauty effect. Applicable scenarios: When the user opens the beauty style and style intensity menu in the app, you can call this method to get the current beauty effect options, then refresh the menu in the user interface according to the results, and update the UI. Call timing: Call this method after calling enableVideo.
| options | Face shaping style options, see FaceShapeBeautyOptions. |
| type | The type of the media source to which the filter effect is applied. See MEDIA_SOURCE_TYPE.Attention: In this method, this parameter supports only the following two settings:
|
|
pure virtual |
Gets the facial beauty area options.
Calling this method can retrieve the current settings of the beauty effect. Applicable scenarios: When the user opens the facial beauty area and shaping intensity menu in the app, you can call this method to get the current beauty effect options, then refresh the menu in the user interface according to the results, and update the UI. Call timing: Call this method after calling enableVideo.
| shapeArea | Facial enhancement areas. See FACE_SHAPE_AREA. |
| options | Facial enhancement areas, see FaceShapeAreaOptions. |
| type | The type of the media source to which the filter effect is applied. See MEDIA_SOURCE_TYPE.Attention: In this method, this parameter supports only the following two settings:
|
|
pure virtual |
Sets low-light enhancement.
You can call this method to enable the color enhancement feature and set the options of the color enhancement effect. Applicable scenarios: The low-light enhancement feature can adaptively adjust the brightness value of the video captured in situations with low or uneven lighting, such as backlit, cloudy, or dark scenes. It restores or highlights the image details and improves the overall visual effect of the video. Call timing: Call this method after calling enableVideo.
libagora_clear_vision_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.setVideoDenoiserOptions to achieve video noise reduction, the specific corresponding relationship is as follows:| enabled | Whether to enable low-light enhancement:
|
| options | The low-light enhancement options. See LowlightEnhanceOptions. |
| type | The type of the media source to which the filter effect is applied. See MEDIA_SOURCE_TYPE.Attention: In this method, this parameter supports only the following two settings:
|
|
pure virtual |
Sets video noise reduction.
You can call this method to enable the video noise reduction feature and set the options of the video noise reduction effect. Applicable scenarios: dark environments and low-end video capture devices can cause video images to contain significant noise, which affects video quality. In real-time interactive scenarios, video noise also consumes bitstream resources and reduces encoding efficiency during encoding. Call timing: Call this method after calling enableVideo.
libagora_clear_vision_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.setBeautyEffectOptions method to enable the beauty and skin smoothing function to achieve better video noise reduction effects. The recommended BeautyOptions settings for intense noise reduction effect are as follows:lighteningContrastLevel LIGHTENING_CONTRAST_NORMALlighteningLevel: 0.0smoothnessLevel: 0.5rednessLevel: 0.0sharpnessLevel: 0.1| enabled | Whether to enable video noise reduction:
|
| options | The video noise reduction options. See VideoDenoiserOptions. |
| type | The type of the media source to which the filter effect is applied. See MEDIA_SOURCE_TYPE.Attention: In this method, this parameter supports only the following two settings:
|
|
pure virtual |
Sets color enhancement.
The video images captured by the camera can have color distortion. The color enhancement feature intelligently adjusts video characteristics such as saturation and contrast to enhance the video color richness and color reproduction, making the video more vivid. You can call this method to enable the color enhancement feature and set the options of the color enhancement effect.
enableVideo.libagora_clear_vision_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.| enabled | Whether to enable color enhancement:
|
| options | The color enhancement options. See ColorEnhanceOptions. |
| type | The type of the media source to which the filter effect is applied. See MEDIA_SOURCE_TYPE.Attention: In this method, this parameter supports only the following two settings:
|
|
pure virtual |
Enables/Disables the virtual background.
The virtual background feature enables the local user to replace their original background with a static image, dynamic video, blurred background, or portrait-background segmentation to achieve picture-in-picture effect. Once the virtual background feature is enabled, all users in the channel can see the custom background. Call this method after calling enableVideo or startPreview(VIDEO_SOURCE_TYPE sourceType).
libagora_segmentation_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.| enabled | Whether to enable virtual background:
|
| backgroundSource | The custom background. See VirtualBackgroundSource. To adapt the resolution of the custom background image to that of the video captured by the SDK, the SDK scales and crops the custom background image while ensuring that the content of the custom background image is not distorted. |
| segproperty | Processing properties for background images. See SegmentationProperty. |
| type | The type of the media source to which the filter effect is applied. See MEDIA_SOURCE_TYPE.Attention: In this method, this parameter supports only the following two settings:
|
|
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. You need to specify the ID of the remote user in this method. If the remote user ID is unknown to the application, set it after the app receives the onUserJoined callback. To unbind the remote user from the view, set the view parameter to NULL. Once the remote user leaves the channel, the SDK unbinds the remote user. In the scenarios of custom layout for mixed videos on the mobile end, you can call this method and set a separate view for rendering each sub-video stream of the mixed video stream.
setRemoteRenderMode method.onFirstRemoteVideoDecoded callback.| canvas | The remote video view and settings. See VideoCanvas. |
|
pure virtual |
Initializes the local video view.
This method initializes the video view of a local stream on the local device. It only affects the video seen by the local user and does not impact the publishing of the local video. Call this method to bind the local video stream to a video view ( view ) and to set the rendering and mirror modes of the video view. The binding remains valid after leaving the channel. To stop rendering or unbind the local video from the view, set view as NULL. Applicable scenarios: After initialization, call this method to set the local video and then join the channel. In real-time interactive scenarios, if you need to simultaneously view multiple preview frames in the local video preview, and each frame is at a different observation position along the video link, you can repeatedly call this method to set different view s and set different observation positions for each view. For example, by setting the video source to the camera and then configuring two view s with position setting to POSITION_POST_CAPTURER_ORIGIN and POSITION_POST_CAPTURER, you can simultaneously preview the raw, unprocessed video frame and the video frame that has undergone preprocessing (image enhancement effects, virtual background, watermark) in the local video preview. Call timing: You can call this method either before or after joining a channel.
setLocalRenderMode(media::base::RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) instead.| canvas | The local video view and settings. See VideoCanvas. |
|
pure virtual |
Sets video application scenarios.
After successfully calling this method, the SDK will automatically enable the best practice strategies and adjust key performance metrics based on the specified scenario, to optimize the video experience.
| scenarioType | The type of video application scenario. See VIDEO_APPLICATION_SCENARIO_TYPE.APPLICATION_SCENARIO_MEETING (1) is suitable for meeting scenarios. The SDK automatically enables the following strategies:
|
IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
pure virtual |
Sets the video qoe preference.
You can call this method to set the expected QoE Preference. The SDK will optimize the video experience for each preference you set.
| qoePreference | The qoe preference type. See VIDEO_QOE_PREFERENCE_TYPE. |
|
pure virtual |
Enables the audio module.
The audio module is enabled by default After calling disableAudio to disable the audio module, you can call this method to re-enable it. Call timing: This method can be called either before or after joining the channel. It is still valid after one leaves channel.
enableLocalAudio: Whether to enable the microphone to create the local audio stream.muteLocalAudioStream: Whether to publish the local audio stream.muteRemoteAudioStream: Whether to subscribe and play the remote audio stream.muteAllRemoteAudioStreams: Whether to subscribe to and play all remote audio streams.enableLocalAudio, muteRemoteAudioStream, and muteAllRemoteAudioStreams. Proceed it with caution.
|
pure virtual |
Disables the audio module.
The audio module is enabled by default, and you can call this method to disable the audio module. Call timing: This method can be called either before or after joining the channel. It is still valid after one leaves channel.
enableLocalAudio: Whether to enable the microphone to create the local audio stream.enableLoopbackRecording: Whether to enable loopback audio capturing.muteLocalAudioStream: Whether to publish the local audio stream.muteRemoteAudioStream: Whether to subscribe and play the remote audio stream.muteAllRemoteAudioStreams: Whether to subscribe to and play all remote audio streams.
|
pure virtual |
Sets the audio profile and audio scenario.
setAudioProfile(AUDIO_PROFILE_TYPE profile) = 0 method instead. To set the audio scenario, call the initialize method and pass value in the audioScenario member in the RtcEngineContext struct.Applicable scenarios: This method is suitable for various audio scenarios. You can choose as needed. For example, in scenarios with high audio quality requirements such as music teaching, it is recommended to set profile to AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4) and scenario to AUDIO_SCENARIO_GAME_STREAMING(3). Call timing: You can call this method either before or after joining a channel.
AUDIO_SCENARIO_GAME_STREAMING(3). In this scenario, the SDK will switch to media volume to avoid this issue.| profile | The audio profile, including the sampling rate, bitrate, encoding mode, and the number of channels. See AUDIO_PROFILE_TYPE. |
| scenario | The audio scenarios. Under different audio scenarios, the device uses different volume types. See AUDIO_SCENARIO_TYPE. |
|
pure virtual |
Sets audio profiles.
If you need to set the audio scenario, you can either call setAudioScenario, or initialize and set the audioScenario in RtcEngineContext. Applicable scenarios: This method is suitable for various audio scenarios. You can choose as needed. For example, in scenarios with high audio quality requirements such as music teaching, it is recommended to set profile to AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4). Call timing: You can call this method either before or after joining a channel.
| profile | The audio profile, including the sampling rate, bitrate, encoding mode, and the number of channels. See AUDIO_PROFILE_TYPE. |
|
pure virtual |
Sets audio scenarios.
Applicable scenarios: This method is suitable for various audio scenarios. You can choose as needed. For example, in scenarios such as music teaching that require high sound quality, it is recommended to set scenario to AUDIO_SCENARIO_GAME_STREAMING(3). Call timing: You can call this method either before or after joining a channel.
AUDIO_SCENARIO_GAME_STREAMING(3). In this scenario, the SDK will switch to media volume to avoid this issue.| scenario | The audio scenarios. Under different audio scenarios, the device uses different volume types. See AUDIO_SCENARIO_TYPE. |
|
pure virtual |
Enables or disables the local audio capture.
The audio function is enabled by default when users joining a channel. This method disables or re-enables the local audio function to stop or restart local audio capturing. The difference between this method and muteLocalAudioStream are as follows:
enableLocalAudio: Disables or re-enables the local audio capturing and processing. If you disable or re-enable local audio capturing using the enableLocalAudio method, the local user might hear a pause in the remote audio playback.muteLocalAudioStream: Sends or stops sending the local audio streams without affecting the audio capture status. Applicable scenarios: This method does not affect receiving the remote audio streams. enableLocalAudio (false) is suitable for scenarios where the user wants to receive remote audio streams without sending locally captured audio. Call timing: You can call this method either before or after joining a channel. Calling it before joining a channel only sets the device state, and it takes effect immediately after you join the channel. Related callbacks: Once the local audio function is disabled or re-enabled, the SDK triggers the onLocalAudioStateChanged callback, which reports LOCAL_AUDIO_STREAM_STATE_STOPPED (0) or LOCAL_AUDIO_STREAM_STATE_RECORDING (1).| enabled |
|
|
pure virtual |
Stops or resumes publishing the local audio stream.
This method is used to control whether to publish the locally captured audio stream. If you call this method to stop publishing locally captured audio streams, the audio capturing device will still work and won't be affected. Call timing: This method can be called either before or after joining the channel. Related callbacks: After successfully calling this method, the local end triggers callback onAudioPublishStateChanged; the remote end triggers onUserMuteAudio and onRemoteAudioStateChanged callbacks.
| mute | Whether to stop publishing the local audio stream:
|
|
pure virtual |
Stops or resumes subscribing to the audio streams of all remote users.
Stops or resumes receiving all remote audio stream.
This method works for all remote users that join or will join a channel using the joinChannel method. It is equivalent to the autoSubscribeAudio member in the ChannelMediaOptions class.
After you successfully call muteAllRemoteAudioStreams(true), you can take the following actions:
enableAudio after muteAllRemoteAudioStreams(true).disableAudio after muteAllRemoteAudioStreams(false).joinChannel. To set whether to receive remote audio streams for a specific channel, Agora recommends using autoSubscribeAudio in the ChannelMediaOptions class. | mute | Whether to stop receiving remote audio streams:
|
After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users. Call timing: Call this method after joining a channel.
enableAudio or disableAudio, the latest call will prevail. By default, the SDK subscribes to the audio streams of all remote users when joining a channel. To modify this behavior, you can set autoSubscribeAudio to false when calling joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options) to join the channel, which will cancel the subscription to the audio streams of all users upon joining the channel.| mute | Whether to stop subscribing to the audio streams of all remote users:
|
|
pure virtual |
Stops or resumes subscribing to the audio stream of a specified user.
Call timing: Call this method after joining a channel. Related callbacks: After a successful method call, the SDK triggers the onAudioSubscribeStateChanged callback.
| uid | The user ID of the specified user. |
| mute | Whether to subscribe to the specified remote user's audio stream.
|
|
pure virtual |
Stops or resumes publishing the local video stream.
This method is used to control whether to publish the locally captured video stream. If you call this method to stop publishing locally captured video streams, the video capturing device will still work and won't be affected. Compared to enableLocalVideo (false), which can also cancel the publishing of local video stream by turning off the local video stream capture, this method responds faster. Call timing: This method can be called either before or after joining the channel. Related callbacks: After successfully calling this method, the local end triggers callback onVideoPublishStateChanged; the remote end triggers onUserMuteVideo and onRemoteVideoStateChanged callbacks.
| mute | Whether to stop publishing the local video stream.
|
|
pure virtual |
Enables/Disables the local video capture.
This method disables or re-enables the local video capture, and does not affect receiving the remote video stream. After calling enableVideo, the local video capture is enabled by default. If you call enableLocalVideo (false) to disable local video capture within the channel, it also simultaneously stops publishing the video stream within the channel. If you want to restart video catpure, you can call enableLocalVideo (true) and then call updateChannelMediaOptions to set the options parameter to publish the locally captured video stream in the channel. After the local video capturer is successfully disabled or re-enabled, the SDK triggers the onRemoteVideoStateChanged callback on the remote client.
| enabled | Whether to enable the local video capture.
|
|
pure virtual |
Stops or resumes subscribing to the video streams of all remote users.
Stops or resumes receiving all remote video streams.
This method works for all remote users that join or will join a channel using the joinChannel method. It is equivalent to the autoSubscribeVideo member in the ChannelMediaOptions class.
After you successfully call muteAllRemoteVideoStreams(true), you can take the following actions:
enableVideo after muteAllRemoteVideoStreams(true).disableVideo after muteAllRemoteVideoStreams(false).joinChannel. To set whether to receive remote audio streams for a specific channel, Agora recommends using autoSubscribeVideo in the ChannelMediaOptions class. | mute | Whether to stop receiving remote video streams:
|
After successfully calling this method, the local user stops or resumes subscribing to the video streams of all remote users, including all subsequent users. Call timing: Call this method after joining a channel.
enableVideo or disableVideo, the latest call will prevail. By default, the SDK subscribes to the video streams of all remote users when joining a channel. To modify this behavior, you can set autoSubscribeVideo tofalse when calling joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options) to join the channel, which will cancel the subscription to the video streams of all users upon joining the channel.| mute | Whether to stop subscribing to the video streams of all remote users.
|
|
pure virtual |
Sets the default video stream type to subscribe to.
Depending on the default behavior of the sender and the specific settings when calling setDualStreamMode(SIMULCAST_STREAM_MODE mode, const SimulcastStreamConfig& streamConfig), the scenarios for the receiver calling this method are as follows:
AUTO_SIMULCAST_STREAM ) on the sender side by default, meaning only the high-quality video stream is transmitted. Only the receiver with the role of the **host**can call this method to initiate a low-quality video stream request. Once the sender receives the request, it starts automatically sending the low-quality video stream. At this point, all users in the channel can call this method to switch to low-quality video stream subscription mode.setDualStreamMode(SIMULCAST_STREAM_MODE mode, const SimulcastStreamConfig& streamConfig) and sets mode to DISABLE_SIMULCAST_STREAM (never send low-quality video stream), then calling this method will have no effect.setDualStreamMode(SIMULCAST_STREAM_MODE mode, const SimulcastStreamConfig& streamConfig) and sets mode to ENABLE_SIMULCAST_STREAM (always send low-quality video stream), both the host and audience receivers can call this method to switch to low-quality video stream subscription mode. The SDK will dynamically adjust the size of the corresponding video stream based on the size of the video window to save bandwidth and computing resources. The default aspect ratio of the low-quality video stream is the same as that of the high-quality video stream. According to the current aspect ratio of the high-quality video stream, the system will automatically allocate the resolution, frame rate, and bitrate of the low-quality video stream. Call timing: Call this method before joining a channel. The SDK does not support changing the default subscribed video stream type after joining a channel.setRemoteVideoStreamType, the setting of setRemoteVideoStreamType takes effect.| streamType | The default video-stream type. See VIDEO_STREAM_TYPE. |
|
pure virtual |
Stops or resumes subscribing to the video stream of a specified user.
Call timing: Call this method after joining a channel. Related callbacks: After a successful method call, the SDK triggers the onVideoSubscribeStateChanged callback.
| uid | The user ID of the specified user. |
| mute | Whether to subscribe to the specified remote user's video stream.
|
|
pure virtual |
Sets the video stream type to subscribe to.
Depending on the default behavior of the sender and the specific settings when calling setDualStreamMode(SIMULCAST_STREAM_MODE mode, const SimulcastStreamConfig& streamConfig), the scenarios for the receiver calling this method are as follows:
AUTO_SIMULCAST_STREAM ) on the sender side by default, meaning only the high-quality video stream is transmitted. Only the receiver with the role of the **host**can call this method to initiate a low-quality video stream request. Once the sender receives the request, it starts automatically sending the low-quality video stream. At this point, all users in the channel can call this method to switch to low-quality video stream subscription mode.setDualStreamMode(SIMULCAST_STREAM_MODE mode, const SimulcastStreamConfig& streamConfig) and sets mode to DISABLE_SIMULCAST_STREAM (never send low-quality video stream), then calling this method will have no effect.setDualStreamMode(SIMULCAST_STREAM_MODE mode, const SimulcastStreamConfig& streamConfig) and sets mode to ENABLE_SIMULCAST_STREAM (always send low-quality video stream), both the host and audience receivers can call this method to switch to low-quality video stream subscription mode. The SDK will dynamically adjust the size of the corresponding video stream based on the size of the video window to save bandwidth and computing resources. The default aspect ratio of the low-quality video stream is the same as that of the high-quality video stream. According to the current aspect ratio of the high-quality video stream, the system will automatically allocate the resolution, frame rate, and bitrate of the low-quality video stream.setRemoteDefaultVideoStreamType, the setting of this method takes effect.| uid | The user ID. |
| streamType | The video stream type, see VIDEO_STREAM_TYPE. |
|
pure virtual |
Options for subscribing to remote video streams.
When a remote user has enabled dual-stream mode, you can call this method to choose the option for subscribing to the video streams sent by the remote user. The default subscription behavior of the SDK for remote video streams depends on the type of registered video observer:
IVideoFrameObserver observer is registered, the default is to subscribe to both raw data and encoded data.IVideoEncodedFrameObserver observer is registered, the default is to subscribe only to the encoded data.IVideoFrameObserver observer, the default is to subscribe to both raw data and encoded data. If you want to modify the default behavior, or set different subscription options for different uids, you can call this method to set it.| uid | The user ID of the remote user. |
| options | The video subscription options. See VideoSubscriptionOptions. |
|
pure virtual |
Sets the allowlist of subscriptions for audio streams.
You can call this method to specify the audio streams of a user that you want to subscribe to.
muteRemoteAudioStream, muteAllRemoteAudioStreams and autoSubscribeAudio in ChannelMediaOptions.| uidList | The user ID list of users that you want to subscribe to. If you want to specify the audio streams of a user for subscription, add the user ID in this list. If you want to remove a user from the allowlist, you need to call the setSubscribeAudioAllowlist method to update the user ID list; this means you only add the uid of users that you want to subscribe to in the new user ID list. |
| uidNumber | The number of users in the user ID list. |
|
pure virtual |
Sets the allowlist of subscriptions for video streams.
You can call this method to specify the video streams of a user that you want to subscribe to.
muteRemoteVideoStream, muteAllRemoteVideoStreams and autoSubscribeAudio in ChannelMediaOptions.| uidList | The user ID list of users that you want to subscribe to. If you want to specify the video streams of a user for subscription, add the user ID of that user in this list. If you want to remove a user from the allowlist, you need to call the setSubscribeVideoAllowlist method to update the user ID list; this means you only add the uid of users that you want to subscribe to in the new user ID list. |
| uidNumber | The number of users in the user ID list. |
|
pure virtual |
Enables the reporting of users' volume indication.
This method enables the SDK to regularly report the volume information to the app of the local user who sends a stream and remote users (three users at most) whose instantaneous volumes are the highest. Call timing: This method can be called either before or after joining the channel. Related callbacks: The SDK triggers the onAudioVolumeIndication callback according to the interval you set if this method is successfully called and there are users publishing streams in the channel.
| interval | Sets the time interval between two consecutive volume indications:
|
| smooth | The smoothing factor that sets the sensitivity of the audio volume indicator. The value ranges between 0 and 10. The recommended value is 3. The greater the value, the more sensitive the indicator. |
| reportVad | - true: Enables the voice activity detection of the local user. Once it is enabled, the vad parameter of the onAudioVolumeIndication callback reports the voice activity status of the local user.
|
|
pure virtual |
Starts client-side audio recording with recording configuration.
The SDK supports recording on the client during a call. After calling this method, you can record the audio of users in the channel and obtain a recording file. The recording file supports the following formats only:
| config | Recording configuration. See AudioRecordingConfiguration. |
Error Codes for details and resolution suggestions.
|
pure virtual |
Starts client-side audio recording and sets the recording sample rate.
The SDK supports recording on the client during a call. After calling this method, you can record the audio of all users in the channel and obtain a recording file that includes all voices. The recording file supports the following formats only:
joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options). If leaveChannel(const LeaveChannelOptions& options) is called while recording is in progress, the recording will automatically stop.sampleRate is set to 44.1 kHz or 48 kHz, it is recommended to set quality to AUDIO_RECORDING_QUALITY_MEDIUM or AUDIO_RECORDING_QUALITY_HIGH.| filePath | The absolute path where the recording file will be saved locally, including the file name and extension. For example: C:\music\audio.aac. Note: Make sure the specified path exists and is writable. |
| sampleRate | Recording sample rate (Hz). You can set it to one of the following values:
|
| quality | Recording quality. See AUDIO_RECORDING_QUALITY_TYPE. |
Error Codes for details and resolution suggestions.
|
pure virtual |
Starts an audio recording.
The SDK allows recording during a call, which supports either one of the following two formats:
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.
| config | Audio recording config. |
|
pure virtual |
Registers an encoded audio observer.
startAudioRecording [3/3] to set the recording type and quality of audio files, but Agora does not recommend using this method and startAudioRecording [3/3] at the same time. Only the method called later will take effect.| config | Observer settings for the encoded audio. See AudioEncodedFrameObserverConfig. |
| observer | The encoded audio observer. See IAudioEncodedFrameObserver. |
|
pure virtual |
Creates a media player object.
Before calling any APIs in the IMediaPlayer class, you need to call this method to create an instance of the media player. If you need to create multiple instances, you can call this method multiple times. Call timing: You can call this method either before or after joining a channel.
IMediaPlayer object, if the method call succeeds.
|
pure virtual |
Destroys the media player instance.
| media_player | IMediaPlayer object. |
|
pure virtual |
Creates an audio and video recording object.
Before starting to record audio and video streams, you need to call this method to create a recording object. The SDK supports recording multiple audio and video streams from local or remote users. You can call this method multiple times to create recording objects, and use the info parameter to specify the channel name and the user ID of the stream to be recorded. After successful creation, you need to call setMediaRecorderObserver to register an observer for the recording object to listen for related callbacks, and then call startRecording to begin recording.
| info | Information about the audio and video stream to be recorded. See RecorderStreamInfo. |
IMediaRecorder object.
|
pure virtual |
Destroys an audio and video recording object.
When you no longer need to record audio and video streams, you can call this method to destroy the corresponding recording object. If recording is in progress, call stopRecording first, then call this method to destroy the recording object.
| mediaRecorder | The IMediaRecorder object to be destroyed. |
Error Codes for details and resolution suggestions.
|
pure virtual |
Selects the audio track used during playback.
After getting the track index of the audio file, you can call this method to specify any track to play. For example, if different tracks of a multi-track file store songs in different languages, you can call this method to set the playback language.
https://docs.agora.io/en/help/general-product-inquiry/audio_format#extended-audio-file-formats.startAudioMixing(const char* filePath, bool loopback, int cycle, int startPos) and receiving the onAudioMixingStateChanged (AUDIO_MIXING_STATE_PLAYING) callback.| index | The audio track you want to specify. The value should be greater than 0 and less than that of returned by getAudioTrackCount. |
|
pure virtual |
Gets the index of audio tracks of the current music file.
startAudioMixing(const char* filePath, bool loopback, int cycle, int startPos) and receiving the onAudioMixingStateChanged (AUDIO_MIXING_STATE_PLAYING) callback.
|
pure virtual |
Enables or disables stereo panning for remote users.
Ensure that you call this method before joining a channel to enable stereo panning for remote users so that the local user can track the position of a remote user by calling setRemoteVoicePosition.
| enabled | Whether to enable stereo panning for remote users:
|
|
pure virtual |
Sets the 2D position (the position on the horizontal plane) of the remote user's voice.
This method sets the 2D position and volume of a remote user, so that the local user can easily hear and identify the remote user's position. When the local user calls this method to set the voice position of a remote user, the voice difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a sense of space. This method applies to massive multiplayer online games, such as Battle Royale games.
enableSoundPositionIndication method before joining a channel.| uid | The user ID of the remote user. |
| pan | The voice position of the remote user. The value ranges from -1.0 to 1.0:
|
| gain | The volume of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original volume of the remote user). The smaller the value, the lower the volume. |
|
pure virtual |
Enables or disables the spatial audio effect.
After enabling the spatial audio effect, you can call setRemoteUserSpatialAudioParams to set the spatial audio effect parameters of the remote user.
libagora_spatial_audio_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.| enabled | Whether to enable the spatial audio effect:
|
|
pure virtual |
Sets a preset voice beautifier effect.
Call this method to set a 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. Call timing: This method can be called either before or after joining the channel. To achieve better vocal effects, it is recommended that you call the following APIs before calling this method:
setAudioScenario to set the audio scenario to high-quality audio scenario, namely AUDIO_SCENARIO_GAME_STREAMING (3).setAudioProfile(AUDIO_PROFILE_TYPE profile) to set the profile parameter to AUDIO_PROFILE_MUSIC_HIGH_QUALITY (4) or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO (5).profile parameter in setAudioProfile(AUDIO_PROFILE_TYPE profile) to AUDIO_PROFILE_SPEECH_STANDARD (1) or AUDIO_PROFILE_IOT (6), or the method does not take effect.setVoiceBeautifierPreset, Agora does not recommend calling the following methods, otherwise the effect set by setVoiceBeautifierPreset will be overwritten:setAudioEffectPresetsetAudioEffectParameterssetLocalVoicePitchsetLocalVoiceEqualizationsetLocalVoiceReverbsetVoiceBeautifierParameterssetVoiceConversionPresetlibagora_audio_beauty_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.| preset | The preset voice beautifier effect options: VOICE_BEAUTIFIER_PRESET. |
|
pure virtual |
Sets a preset voice beautifier effect.
Call this method to set a preset voice changing effect for the local user who publishes an audio stream in a channel. After setting the voice changing effect, all users in the channel can hear the effect. You can set different voice changing effects for the user depending on different scenarios. Call timing: This method can be called either before or after joining the channel. To achieve better vocal effects, it is recommended that you call the following APIs before calling this method:
setAudioScenario to set the audio scenario to high-quality audio scenario, namely AUDIO_SCENARIO_GAME_STREAMING (3).setAudioProfile(AUDIO_PROFILE_TYPE profile) to set the profile parameter to AUDIO_PROFILE_MUSIC_HIGH_QUALITY (4) or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO (5).profile parameter in setAudioProfile(AUDIO_PROFILE_TYPE profile) to AUDIO_PROFILE_SPEECH_STANDARD (1) or AUDIO_PROFILE_IOT (6), or the method does not take effect.setVoiceConversionPreset, Agora does not recommend you to call the following methods, otherwise the effect set by setVoiceConversionPreset will be overwritten:setAudioEffectPresetsetAudioEffectParameterssetVoiceBeautifierPresetsetVoiceBeautifierParameterssetLocalVoicePitchsetLocalVoiceFormantsetLocalVoiceEqualizationsetLocalVoiceReverblibagora_audio_beauty_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.| preset | The options for the preset voice beautifier effects: VOICE_CONVERSION_PRESET. |
|
pure virtual |
Sets parameters for the preset voice beautifier effects.
Call this method to set a gender characteristic and a reverberation effect for the singing beautifier effect. This method sets parameters for the local user who sends an audio stream. After setting the audio parameters, all users in the channel can hear the effect. To achieve better vocal effects, it is recommended that you call the following APIs before calling this method:
setAudioScenario to set the audio scenario to high-quality audio scenario, namely AUDIO_SCENARIO_GAME_STREAMING (3).setAudioProfile(AUDIO_PROFILE_TYPE profile) to set the profile parameter to AUDIO_PROFILE_MUSIC_HIGH_QUALITY (4) or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO (5).profile parameter in setAudioProfile(AUDIO_PROFILE_TYPE profile) to AUDIO_PROFILE_SPEECH_STANDARD (1) or AUDIO_PROFILE_IOT (6), or the method does not take effect.setVoiceBeautifierParameters, Agora does not recommend calling the following methods, otherwise the effect set by setVoiceBeautifierParameters will be overwritten:setAudioEffectPresetsetAudioEffectParameterssetVoiceBeautifierPresetsetLocalVoicePitchsetLocalVoiceEqualizationsetLocalVoiceReverbsetVoiceConversionPresetlibagora_audio_beauty_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.| preset | The option for the preset audio effect:
|
| param1 | The gender characteristics options for the singing voice:
|
| param2 | The reverberation effect options for the singing voice:
|
|
pure virtual |
Set parameters for SDK preset voice conversion.
| preset | The options for SDK preset audio effects. See VOICE_CONVERSION_PRESET. |
| param1 | reserved. |
| param2 | reserved. |
|
pure virtual |
Sets the preset headphone equalization effect.
This method is mainly used in spatial audio effect scenarios. You can select the preset headphone equalizer to listen to the audio to achieve the expected audio experience.
| preset | The preset headphone equalization effect. See HEADPHONE_EQUALIZER_PRESET. |
|
pure virtual |
Sets the low- and high-frequency parameters of the headphone equalizer.
In a spatial audio effect scenario, if the preset headphone equalization effect is not achieved after calling the setHeadphoneEQPreset method, you can further adjust the headphone equalization effect by calling this method.
| lowGain | The low-frequency parameters of the headphone equalizer. The value range is [-10,10]. The larger the value, the deeper the sound. |
| highGain | The high-frequency parameters of the headphone equalizer. The value range is [-10,10]. The larger the value, the sharper the sound. |
|
pure virtual |
Enables or disables the voice AI tuner.
The voice AI tuner supports enhancing sound quality and adjusting tone style. Applicable scenarios: Social entertainment scenes including online KTV, online podcast and live streaming in showrooms, where high sound quality is required. Call timing: This method can be called either before or after joining the channel.
| enabled | Whether to enable the voice AI tuner:
|
| type | Voice AI tuner sound types, see VOICE_AI_TUNER_TYPE. |
|
pure virtual |
Sets the log file.
Specifies an SDK output log file. The log file records all log data for the SDK’s operation. Call timing: This method needs to be called immediately after initialize, otherwise the output log may be incomplete.
| filePath | The complete path of the log files. These log files are encoded in UTF-8. |
|
pure virtual |
Sets the log output level of the SDK.
This method 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 LOG_FILTER_OFF, LOG_FILTER_CRITICAL, LOG_FILTER_ERROR, LOG_FILTER_WARN, LOG_FILTER_INFO, and LOG_FILTER_DEBUG. Choose a level to see the logs preceding that level. If, for example, you set the log level to LOG_FILTER_WARN, you see the logs within levels LOG_FILTER_CRITICAL, LOG_FILTER_ERROR and LOG_FILTER_WARN.
| filter | The output log level of the SDK. See LOG_FILTER_TYPE. |
|
pure virtual |
Sets the output log level of the SDK.
Choose a level to see the logs preceding that level.
| level | The log level. See LOG_LEVEL. |
|
pure virtual |
Sets the log file size.
By default, the SDK generates five SDK log files and five API call log files with the following rules:
agorasdk.log, agorasdk.1.log, agorasdk.2.log, agorasdk.3.log, and agorasdk.4.log.agoraapi.log, agoraapi.1.log, agoraapi.2.log, agoraapi.3.log, and agoraapi.4.log.agorasdk.log or agoraapi.log.agorasdk.log is full, the SDK processes the log files in the following order:1. Delete the agorasdk.4.log file (if any).agorasdk.3.log to agorasdk.4.log.agorasdk.2.log to agorasdk.3.log.agorasdk.1.log to agorasdk.2.log.agorasdk.log file.agoraapi.log file are the same as for agorasdk.log.agorasdk.log file only and does not effect the agoraapi.log file.| fileSizeInKBytes | The size (KB) of an agorasdk.log file. The value range is [128,20480]. The default value is 2,048 KB. If you set fileSizeInKByte smaller than 128 KB, the SDK automatically adjusts it to 128 KB; if you set fileSizeInKByte greater than 20,480 KB, the SDK automatically adjusts it to 20,480 KB. |
|
pure virtual |
Upload current log file immediately to server. only use this when an error occurs block before log file upload success or timeout.
|
pure virtual |
You can Write the log to SDK log files of the specified level.
| level | The log level:
|
|
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 and does not impact the publishing of the local video. Call timing: - Ensure that you have called the setupLocalVideo method to initialize the local video view before calling this method.
(PRIMARY_CAMERA_SOURCE). In scenarios involving custom video capture or the use of alternative video sources, you need to use setupLocalVideo instead of this method.| renderMode | The local video display mode. See RENDER_MODE_TYPE. |
| mirrorMode | The mirror mode of the local video view. See VIDEO_MIRROR_MODE_TYPE. Attention: If you use a front camera, the SDK enables the mirror mode by default; if you use a rear camera, the SDK disables the mirror mode by default. |
|
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.
setupRemoteVideo method.| uid | The user ID of the remote user. |
| renderMode | The rendering mode of the remote user view. For details, see RENDER_MODE_TYPE. |
| mirrorMode | The mirror mode of the remote user view. See VIDEO_MIRROR_MODE_TYPE. |
|
pure virtual |
Sets the maximum frame rate for rendering local video.
Applicable scenarios: In scenarios where the requirements for video rendering frame rate are not high (such as screen sharing or online education), you can call this method to set the maximum frame rate for local video rendering. The SDK will attempt to keep the actual frame rate of local rendering close to this value, which helps to reduce CPU consumption and improving system performance. Call timing: You can call this method either before or after joining a channel.
| sourceType | The type of the video source. See VIDEO_SOURCE_TYPE. |
| targetFps | The capture frame rate (fps) of the local video. Sopported values are: 1, 7, 10, 15, 24, 30, 60.CAUTION: Set this parameter to a value lower than the actual video frame rate; otherwise, the settings do not take effect. |
|
pure virtual |
Sets the maximum frame rate for rendering remote video.
Applicable scenarios: In scenarios where the video rendering frame rate is not critical (e.g., screen sharing, online education) or when the remote users are using mid-to-low-end devices, you can call this method to set the maximum frame rate for video rendering on the remote client. The SDK will attempt to render the actual frame rate as close as possible to this value, which helps to reduce CPU consumption and improve system performance. Call timing: You can call this method either before or after joining a channel.
| targetFps | The capture frame rate (fps) of the local video. Sopported values are: 1, 7, 10, 15, 24, 30, 60.CAUTION: Set this parameter to a value lower than the actual video frame rate; otherwise, the settings do not take effect. |
|
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 mode. It affects only the video view that the local user sees, not the published local video stream.
| renderMode | Sets the local display mode. See #RENDER_MODE_TYPE. |
|
pure virtual |
Sets the local video mirror mode.
| mirrorMode | The local video mirror mode. See VIDEO_MIRROR_MODE_TYPE. |
|
pure virtual |
Enables or disables dual-stream mode on the sender side.
Dual streams are a pairing of a high-quality video stream and a low-quality video stream:
setRemoteVideoStreamType to choose to receive either the high-quality video stream or the low-quality video stream on the subscriber side.enableDualStreamModeEx method.| enabled | Whether to enable dual-stream mode:
|
|
pure virtual |
Sets the dual-stream mode on the sender side and the low-quality video stream.
You can call this method to enable or disable the dual-stream mode on the publisher side. Dual streams are a pairing of a high-quality video stream and a low-quality video stream:
setRemoteVideoStreamType to choose to receive either the high-quality video stream or the low-quality video stream on the subscriber side.enableDualStreamModeEx method.| enabled | Whether to enable dual-stream mode:
|
| streamConfig | The configuration of the low-quality video stream. See SimulcastStreamConfig.Note: When setting mode to DISABLE_SIMULCAST_STREAM, setting streamConfig will not take effect. |
|
pure virtual |
Sets the dual-stream mode on the sender side.
The SDK defaults to enabling low-quality video stream adaptive mode ( AUTO_SIMULCAST_STREAM ) on the sender side, which means the sender does not actively send low-quality video stream. The receiving end with the role of the host can initiate a low-quality video stream request by calling setRemoteVideoStreamType, and upon receiving the request, the sending end automatically starts sending low-quality stream.
mode to DISABLE_SIMULCAST_STREAM (never send low-quality video streams) or ENABLE_SIMULCAST_STREAM (always send low-quality video streams).mode set to AUTO_SIMULCAST_STREAM.enableDualStreamMode(bool enabled) is as follows:mode to DISABLE_SIMULCAST_STREAM, it has the same effect as enableDualStreamMode(bool enabled) (false).mode to ENABLE_SIMULCAST_STREAM, it has the same effect as enableDualStreamMode(bool enabled) (true).| mode | The mode in which the video stream is sent. See SIMULCAST_STREAM_MODE. |
|
pure virtual |
Sets the simulcast video stream configuration.
You can call this method to set video streams with different resolutions for the same video source. The subscribers can call setRemoteVideoStreamType to select which stream layer to receive. The broadcaster can publish up to four layers of video streams: one main stream (highest resolution) and three additional streams of different quality levels.
| simulcastConfig | This configuration includes seven layers, from STREAM_LAYER_1 to STREAM_LOW, with a maximum of three layers enabled simultaneously. See SimulcastConfig. |
|
pure virtual |
Sets dual-stream mode configuration on the sender side.
The SDK defaults to enabling low-quality video stream adaptive mode ( AUTO_SIMULCAST_STREAM ) on the sender side, which means the sender does not actively send low-quality video stream. The receiving end with the role of the host can initiate a low-quality video stream request by calling setRemoteVideoStreamType, and upon receiving the request, the sending end automatically starts sending low-quality stream.
mode to DISABLE_SIMULCAST_STREAM (never send low-quality video streams) or ENABLE_SIMULCAST_STREAM (always send low-quality video streams).mode set to AUTO_SIMULCAST_STREAM. The difference between this method and setDualStreamMode(SIMULCAST_STREAM_MODE mode) is that this method can also configure the low-quality video stream, and the SDK sends the stream according to the configuration in streamConfig.enableDualStreamMode(bool enabled, const SimulcastStreamConfig& streamConfig) is as follows:mode to DISABLE_SIMULCAST_STREAM, it has the same effect as calling enableDualStreamMode(bool enabled, const SimulcastStreamConfig& streamConfig) and setting enabled to false.mode to ENABLE_SIMULCAST_STREAM, it has the same effect as calling enableDualStreamMode(bool enabled, const SimulcastStreamConfig& streamConfig) and setting enabled to true.| mode | The mode in which the video stream is sent. See SIMULCAST_STREAM_MODE. |
| streamConfig | The configuration of the low-quality video stream. See SimulcastStreamConfig.Note: When setting mode to DISABLE_SIMULCAST_STREAM, setting streamConfig will not take effect. |
|
pure virtual |
Sets whether to enable the local playback of external audio source.
After calling this method to enable the local playback of external audio source, if you need to stop local playback, you can call this method again and set enabled to false. You can call adjustCustomAudioPlayoutVolume to adjust the local playback volume of the custom audio track.
createCustomAudioTrack method to create a custom audio track before calling this method.| trackId | The audio track ID. Set this parameter to the custom audio track ID returned in createCustomAudioTrack. |
| enabled | Whether to play the external audio source:
|
|
pure virtual |
Sets the format of the captured raw audio data.
The SDK calculates the sampling interval based on the samplesPerCall, sampleRate and channel parameters set in this method.Sample interval (sec) = samplePerCall /( sampleRate × channel ). Ensure that the sample interval ≥ 0.01 (s). The SDK triggers the onRecordAudioFrame callback according to the sampling interval. Call timing: Call this method before joining a channel.
| sampleRate | The sample rate returned in the callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
| channel | The number of audio channels. You can set the value as 1 or 2.
|
| mode | The use mode of the audio frame. See RAW_AUDIO_FRAME_OP_MODE_TYPE. |
| samplesPerCall | The number of data samples, such as 1024 for the Media Push. |
|
pure virtual |
Sets the format of the raw audio playback data.
The SDK calculates the sampling interval based on the samplesPerCall, sampleRate and channel parameters set in this method.Sample interval (sec) = samplePerCall /( sampleRate × channel ). Ensure that the sample interval ≥ 0.01 (s). The SDK triggers the onPlaybackAudioFrame callback according to the sampling interval. Call timing: Call this method before joining a channel.
| sampleRate | The sample rate returned in the callback, which can be set as 8000, 16000, 24000, 32000, 44100, or 48000 Hz. |
| channel | The number of audio channels. You can set the value as 1 or 2.
|
| mode | The use mode of the audio frame. See RAW_AUDIO_FRAME_OP_MODE_TYPE. |
| samplesPerCall | The number of data samples, such as 1024 for the Media Push. |
|
pure virtual |
Sets the format of the raw audio data after mixing for audio capture and playback.
The SDK calculates the sampling interval based on the samplesPerCall, sampleRate and channel parameters set in this method.Sample interval (sec) = samplePerCall /( sampleRate × channel ). Ensure that the sample interval ≥ 0.01 (s). The SDK triggers the onMixedAudioFrame callback according to the sampling interval. Call timing: Call this method before joining a channel.
| sampleRate | The sample rate returned in the callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
| channel | The number of audio channels. You can set the value as 1 or 2.
|
| samplesPerCall | The number of data samples, such as 1024 for the Media Push. |
|
pure virtual |
Sets the format of the in-ear monitoring raw audio data.
This method is used to set the in-ear monitoring audio data format reported by the onEarMonitoringAudioFrame callback.
enableInEarMonitoring, and set includeAudioFilters to EAR_MONITORING_FILTER_BUILT_IN_AUDIO_FILTERS or EAR_MONITORING_FILTER_NOISE_SUPPRESSION.samplesPerCall, sampleRate and channel parameters set in this method.Sample interval (sec) = samplePerCall /( sampleRate × channel ). Ensure that the sample interval ≥ 0.01 (s). The SDK triggers the onEarMonitoringAudioFrame callback according to the sampling interval.| sampleRate | The sample rate of the audio data reported in the onEarMonitoringAudioFrame callback, which can be set as 8,000, 16,000, 32,000, 44,100, or 48,000 Hz. |
| channel | The number of audio channels reported in the onEarMonitoringAudioFrame callback.
|
| mode | The use mode of the audio frame. See RAW_AUDIO_FRAME_OP_MODE_TYPE. |
| samplesPerCall | The number of data samples reported in the onEarMonitoringAudioFrame callback, such as 1,024 for the Media Push. |
|
pure virtual |
Sets the format of the raw audio playback data before mixing.
The SDK triggers the onPlaybackAudioFrameBeforeMixing callback according to the sampling interval. Call timing: Call this method before joining a channel.
| sampleRate | The sample rate returned in the callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
| channel | The number of audio channels. You can set the value as 1 or 2.
|
|
pure virtual |
Sets the format of audio data in the onPlaybackAudioFrameBeforeMixing callback.
Used to set the sample rate, number of channels, and number of samples per callback for the audio data returned in the onPlaybackAudioFrameBeforeMixing callback.
| sampleRate | Set the sample rate returned in the onPlaybackAudioFrameBeforeMixing callback. It can be set as the following values: 8000、16000、32000、44100 or 48000. |
| channel | Set the number of channels for the audio data returned in the onPlaybackAudioFrameBeforeMixing callback. It can be set to:
|
| samplesPerCall | Set the sample rate of the audio data returned in the onPlaybackAudioFrameBeforeMixing callback. In the RTMP streaming scenario, it is recommended to set it to 1024. |
|
pure virtual |
Turns on audio spectrum monitoring.
If you want to obtain the audio spectrum data of local or remote users, you can register the audio spectrum observer and enable audio spectrum monitoring.
| intervalInMS | The interval (in milliseconds) at which the SDK triggers the onLocalAudioSpectrum and onRemoteAudioSpectrum callbacks. The default value is 100. Do not set this parameter to a value less than 10, otherwise calling this method would fail. |
|
pure virtual |
Disables audio spectrum monitoring.
After calling enableAudioSpectrumMonitor, if you want to disable audio spectrum monitoring, you can call this method.
|
pure virtual |
Registers an audio spectrum observer.
After successfully registering the audio spectrum observer and calling enableAudioSpectrumMonitor to enable the audio spectrum monitoring, the SDK reports the callback that you implement in the IAudioSpectrumObserver class according to the time interval you set.
| observer | The audio spectrum observer. See IAudioSpectrumObserver. |
|
pure virtual |
Unregisters the audio spectrum observer.
After calling registerAudioSpectrumObserver, if you want to disable audio spectrum monitoring, you can call this method.
| observer | The audio spectrum observer. See IAudioSpectrumObserver. |
|
pure virtual |
Adjusts the capturing signal volume.
If you only need to mute the audio signal, Agora recommends that you use muteRecordingSignal instead. Call timing: This method can be called either before or after joining the channel.
| volume | The volume of the user. The value range is [0,400].
|
|
pure virtual |
Whether to mute the recording signal.
If you have already called adjustRecordingSignalVolume to adjust the recording signal volume, when you call this method and set it to true, the SDK behaves as follows:1. Records the adjusted volume.
false, the recording signal volume will be restored to the volume recorded by the SDK before muting. Call timing: This method can be called either before or after joining the channel.| mute | - true: Mute the recording signal.
|
|
pure virtual |
Adjusts the playback signal volume of all remote users.
This method is used to adjust the signal volume of all remote users mixed and played locally. If you need to adjust the signal volume of a specified remote user played locally, it is recommended that you call adjustUserPlaybackSignalVolume instead. Call timing: This method can be called either before or after joining the channel.
| volume | The volume of the user. The value range is [0,400].
|
|
pure virtual |
Adjusts the playback signal volume of a specified remote user.
You can call this method to adjust the playback volume of a specified remote user. To adjust the playback volume of different remote users, call the method as many times, once for each remote user. Call timing: Call this method after joining a channel.
| uid | The user ID of the remote user. |
| volume | The volume of the user. The value range is [0,400].
|
|
pure virtual |
Sets the fallback option for the subscribed video stream based on the network conditions.
An unstable network affects the audio and video quality in a video call or interactive live video streaming. If option is set as STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW or STREAM_FALLBACK_OPTION_AUDIO_ONLY, the SDK automatically switches the video from a high-quality stream to a low-quality stream or disables the video when the downlink network conditions cannot support both audio and video to guarantee the quality of the audio. Meanwhile, the SDK continuously monitors network quality and resumes subscribing to audio and video streams when the network quality improves. When the subscribed video stream falls back to an audio-only stream, or recovers from an audio-only stream to an audio-video stream, the SDK triggers the onRemoteSubscribeFallbackToAudioOnly callback.
| option | Fallback options for the subscribed stream. See STREAM_FALLBACK_OPTIONS. |
|
pure virtual |
Sets the high priority user list and their fallback level in weak network condition.
| uidList | The high priority user list. |
| uidNum | The size of uidList. |
| option | The fallback level of high priority users. |
|
pure virtual |
Enable/Disable an extension. By calling this function, you can dynamically enable/disable the extension without changing the pipeline. For example, enabling/disabling Extension_A means the data will be adapted/bypassed by Extension_A.
NOTE: For compatibility reasons, if you haven't call registerExtension, enableExtension will automatically register the specified extension. We suggest you call registerExtension explicitly.
| provider | The name of the extension provider, e.g. agora.io. |
| extension | The name of the extension, e.g. agora.beauty. |
| extensionInfo | The information for extension. |
| enable | Whether to enable the extension:
|
|
pure virtual |
Sets the properties of an extension.
| provider | The name of the extension provider, e.g. agora.io. |
| extension | The name of the extension, e.g. agora.beauty. |
| extensionInfo | The information for extension. |
| key | The key of the extension. |
| value | The JSON formatted value of the extension key. |
|
pure virtual |
Gets the properties of an extension.
| provider | The name of the extension provider, e.g. agora.io. |
| extension | The name of the extension, e.g. agora.beauty. |
| extensionInfo | The information for extension. |
| key | The key of the extension. |
| value | The value of the extension key. |
| buf_len | Maximum length of the JSON string indicating the extension property. |
|
pure virtual |
Enables loopback audio capturing.
If you enable loopback audio capturing, the output of the sound card is mixed into the audio stream sent to the other end.
disableAudio method to disable the audio module, audio capturing will be disabled as well. If you need to enable audio capturing, call the enableAudio method to enable the audio module and then call the enableLoopbackRecording method.| enabled | Sets whether to enable loopback audio capturing.
|
| deviceName | - macOS: The device name of the virtual sound card. The default value is set to NULL, which means using AgoraALD for loopback audio capturing.
|
|
pure virtual |
Adjusts the volume of the signal captured by the sound card.
After calling enableLoopbackRecording to enable loopback audio capturing, you can call this method to adjust the volume of the signal captured by the sound card.
| volume | Audio mixing volume. The value ranges between 0 and 100. The default value is 100, which means the original volume. |
|
pure virtual |
Retrieves the audio volume for recording loopback.
|
pure virtual |
Enables in-ear monitoring.
This method enables or disables in-ear monitoring. Call timing: This method can be called either before or after joining the channel.
| enabled | Enables or disables in-ear monitoring.
|
| includeAudioFilters | The audio filter types of in-ear monitoring. See EAR_MONITORING_FILTER_TYPE. |
|
pure virtual |
Sets the volume of the in-ear monitor.
Call timing: This method can be called either before or after joining the channel.
| volume | The volume of the user. The value range is [0,400].
|
|
pure virtual |
Sets the properties of the extension provider.
You can call this method to set the attributes of the extension provider and initialize the relevant parameters according to the type of the provider. Call timing: Call this method before enableExtension and after registerExtension.
| provider | The name of the extension provider. |
| key | The key of the extension. |
| value | The value of the extension key. |
|
pure virtual |
Registers an extension.
For extensions external to the SDK (such as those from Extensions Marketplace and SDK Extensions), you need to load them before calling this method. Extensions internal to the SDK (those included in the full SDK package) are automatically loaded and registered after the initialization of IRtcEngine. Call timing: - Agora recommends you call this method after the initialization of IRtcEngine and before joining a channel.
enableVideo or enableLocalVideo.loadExtensionProvider to load the extension first.| provider | The name of the extension provider. |
| extension | The name of the extension. |
| type | Source type of the extension. See MEDIA_SOURCE_TYPE. |
|
pure virtual |
Enables or disables extensions.
Call timing: Agora recommends that you call this method after joining a channel. Related callbacks: When this method is successfully called within the channel, it triggers onExtensionStartedWithContext or onExtensionStoppedWithContext.
| provider | The name of the extension provider. |
| extension | The name of the extension. |
| enable | Whether to enable the extension:
|
| type | Source type of the extension. See MEDIA_SOURCE_TYPE. |
|
pure virtual |
Sets the properties of the extension.
After enabling the extension, you can call this method to set the properties of the extension. Call timing: Call this mehtod after calling enableExtension. Related callbacks: After calling this method, it may trigger the onExtensionEventWithContext callback, and the specific triggering logic is related to the extension itself.
| provider | The name of the extension provider. |
| extension | The name of the extension. |
| key | The key of the extension. |
| value | The value of the extension key. |
| type | Source type of the extension. See MEDIA_SOURCE_TYPE. |
|
pure virtual |
Gets detailed information on the extensions.
Call timing: This method can be called either before or after joining the channel.
| provider | An output parameter. The name of the extension provider. |
| extension | An output parameter. The name of the extension. |
| key | An output parameter. The key of the extension. |
| value | An output parameter. The value of the extension key. |
| type | Source type of the extension. See MEDIA_SOURCE_TYPE. |
| buf_len | Maximum length of the JSON string indicating the extension property. The maximum value is 512 bytes. |
|
pure virtual |
Creates a custom video track.
To publish a custom video source, see the following steps:1. Call this method to create a video track and get the video track ID.
joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options) to join the channel. In ChannelMediaOptions, set customVideoTrackId to the video track ID that you want to publish, and set publishCustomVideoTrack to true.pushVideoFrame and specify videoTrackId as the video track ID set in step 2. You can then publish the corresponding custom video source in the channel.
|
pure virtual |
Get an custom encoded video track id created by internal,which could used to publish or preview
|
pure virtual |
Destroys the specified video track.
| video_track_id | The video track ID returned by calling the createCustomVideoTrack method. |
|
pure virtual |
destroy a created custom encoded video track id
| video_track_id | The video track id which was created by createCustomEncodedVideoTrack |
|
pure virtual |
Retrieves the call ID.
When a user joins a channel on a client, a callId is generated to identify the call from the client. You can call this method to get callId, and pass it in when calling methods such as rate and complain. Call timing: Call this method after joining a channel.
| callId | Output parameter, the current call ID. |
|
pure virtual |
Allows a user to rate a call after the call ends.
| callId | The current call ID. You can get the call ID by calling getCallId. |
| rating | The value is between 1 (the lowest score) and 5 (the highest score). |
| description | (Optional) A description of the call. The string length should be less than 800 bytes. |
|
pure virtual |
Allows a user to complain about the call quality after a call ends.
This method allows users to complain about the quality of the call. Call this method after the user leaves the channel.
| callId | The current call ID. You can get the call ID by calling getCallId. |
| description | (Optional) A description of the call. The string length should be less than 800 bytes. |
IRtcEngine is initialized.
|
pure virtual |
Starts pushing media streams to a CDN without transcoding.
Agora recommends that you use the server-side Media Push function. For details, see Use RESTful API. You can call this method to push an audio or video stream to the specified CDN address. This method can push media streams to only one CDN address at a time, so if you need to push streams to multiple addresses, call this method multiple times. After you call this method, the SDK triggers the onRtmpStreamingStateChanged callback on the local client to report the state of the streaming.
stopRtmpStream first, then call this method to retry pushing streams; otherwise, the SDK returns the same error code as the last failed push.| url | The address of Media Push. The format is RTMP or RTMPS. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported. |
|
pure virtual |
Starts Media Push and sets the transcoding configuration.
Agora recommends that you use the server-side Media Push function. For details, see Use RESTful API. You can call this method to push a live audio-and-video stream to the specified CDN address and set the transcoding configuration. This method can push media streams to only one CDN address at a time, so if you need to push streams to multiple addresses, call this method multiple times. Under one Agora project, the maximum number of concurrent tasks to push media streams is 200 by default. If you need a higher quota, contact technical support. After you call this method, the SDK triggers the onRtmpStreamingStateChanged callback on the local client to report the state of the streaming.
stopRtmpStream first, then call this method to retry pushing streams; otherwise, the SDK returns the same error code as the last failed push.| url | The address of Media Push. The format is RTMP or RTMPS. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported. |
| transcoding | The transcoding configuration for Media Push. See LiveTranscoding. |
|
pure virtual |
Updates the transcoding configuration.
Agora recommends that you use the server-side Media Push function. For details, see Use RESTful API. After you start pushing media streams to CDN with transcoding, you can dynamically update the transcoding configuration according to the scenario. The SDK triggers the onTranscodingUpdated callback after the transcoding configuration is updated.
| transcoding | The transcoding configuration for Media Push. See LiveTranscoding. |
|
pure virtual |
Starts the local video mixing.
After calling this method, you can merge multiple video streams into one video stream locally. For example, you can merge the video streams captured by the camera, screen sharing, media player, remote video, video files, images, etc. into one video stream, and then publish the mixed video stream to the channel. Applicable scenarios: You can enable the local video mixing function in scenarios such as remote conferences, live streaming, and online education, which allows users to view and manage multiple videos more conveniently, and supports portrait-in-picture effect and other functions. The following is a typical use case for implementing the portrait-in-picture effect:1. Call enableVirtualBackground, and set the custom background image to BACKGROUND_NONE, that is, separate the portrait and the background in the video captured by the camera.
startScreenCapture(VIDEO_SOURCE_TYPE sourceType, const ScreenCaptureConfiguration& config) to start capturing the screen sharing video stream.startCameraCapture or startScreenCapture(VIDEO_SOURCE_TYPE sourceType, const ScreenCaptureConfiguration& config).publishTranscodedVideoTrack in ChannelMediaOptions to true when calling joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options) or updateChannelMediaOptions. Related callbacks: When you fail to call this method, the SDK triggers the onLocalVideoTranscoderError callback to report the reason.| config | Configuration of the local video mixing, see LocalTranscoderConfiguration.Attention:
|
|
pure virtual |
Updates the local video mixing configuration.
After calling startLocalVideoTranscoder, call this method if you want to update the local video mixing configuration.
startCameraCapture or startScreenCapture(VIDEO_SOURCE_TYPE sourceType, const ScreenCaptureConfiguration& config).| config | Configuration of the local video mixing, see LocalTranscoderConfiguration. |
|
pure virtual |
Stops pushing media streams to a CDN.
Agora recommends that you use the server-side Media Push function. For details, see Use RESTful API. You can call this method to stop the live stream on the specified CDN address. This method can stop pushing media streams to only one CDN address at a time, so if you need to stop pushing streams to multiple addresses, call this method multiple times. After you call this method, the SDK triggers the onRtmpStreamingStateChanged callback on the local client to report the state of the streaming.
| url | The address of Media Push. The format is RTMP or RTMPS. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported. |
|
pure virtual |
Stops the local video mixing.
After calling startLocalVideoTranscoder, call this method if you want to stop the local video mixing.
|
pure virtual |
Starts local audio mixing.
This method supports merging multiple audio streams into one audio stream locally. For example, merging the audio streams captured from the local microphone, and that from the media player, the sound card, and the remote users into one audio stream, and then publish the merged audio stream to the channel.
ChannelMediaOptions to true, and then publish the mixed audio stream to the channel.| config | The configurations for mixing the lcoal audio. See LocalAudioMixerConfiguration. |
IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
pure virtual |
Updates the configurations for mixing audio streams locally.
After calling startLocalAudioMixer, call this method if you want to update the local audio mixing configuration. Call timing: Call this method after startLocalAudioMixer.
| config | The configurations for mixing the lcoal audio. See LocalAudioMixerConfiguration. |
IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
pure virtual |
Stops the local audio mixing.
After calling startLocalAudioMixer, call this method if you want to stop the local audio mixing. Call timing: Call this method after startLocalAudioMixer.
IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
pure virtual |
Starts camera capture.
You can call this method to start capturing video from one or more cameras by specifying sourceType.
enableMultiCamera and set enabled to true before calling this method.| sourceType | The type of the video source. See VIDEO_SOURCE_TYPE. Note:
|
| config | The configuration of the video capture. See CameraCapturerConfiguration. Note: On the iOS platform, this parameter has no practical function. Use the config parameter in enableMultiCamera instead to set the video capture configuration. |
|
pure virtual |
Stops camera capture.
After calling startCameraCapture to start capturing video through one or more cameras, you can call this method and set the sourceType parameter to stop the capture from the specified cameras.
enableMultiCamera after calling this method and set enabled to false.| sourceType | The type of the video source. See VIDEO_SOURCE_TYPE. |
|
pure virtual |
Sets the rotation angle of the video captured by the screen.
When the screen capture device does not have the gravity sensing function, you can call this method to manually adjust the rotation angle of the captured video.
| type | The video source type. See VIDEO_SOURCE_TYPE. |
| orientation | The clockwise rotation angle. See VIDEO_ORIENTATION. |
|
pure virtual |
Starts screen capture from the specified video source.
Applicable scenarios: In the screen sharing scenario, you need to call this method to start capturing the screen video stream. The SDK supports a series of methods for screen capturing, with the following distinctions between them. Please choose according to the actual scenario:
startScreenCapture(const ScreenCaptureParameters2& captureParams) / startScreenCaptureByDisplayId / startScreenCaptureByWindowId: Only supports capturing a single screen or window, suitable for scenarios where only a single screen is shared.startScreenCapture(VIDEO_SOURCE_TYPE sourceType, const ScreenCaptureConfiguration& config): Supports specifying multiple video sources to capture multiple screen sharing streams, used for local video mixing or multi-channel scenarios. Call timing: You can call this method either before or after joining the channel, with the following differences:joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options) to join channel and set publishScreenCaptureVideo to true to start screen sharing.updateChannelMediaOptions and set publishScreenCaptureVideo to true to start screen sharing.stopScreenCapture(VIDEO_SOURCE_TYPE sourceType) to stop screen capture.| sourceType | The type of the video source. See VIDEO_SOURCE_TYPE.Attention: On the macOS platform, this parameter can only be set to VIDEO_SOURCE_SCREEN (2). |
| config | The configuration of the captured screen. See ScreenCaptureConfiguration. |
|
pure virtual |
Stops screen capture from the specified video source.
Applicable scenarios: If you start screen capture from one or more screens by calling startScreenCapture(VIDEO_SOURCE_TYPE sourceType, const ScreenCaptureConfiguration& config), you need to call this method to stop screen capture, specifying the screen through the sourceType parameter. Call timing: You can call this method either before or after joining a channel.
| sourceType | The type of the video source. See VIDEO_SOURCE_TYPE. |
|
pure virtual |
Gets the current connection state of the SDK.
Call timing: This method can be called either before or after joining the channel.
CONNECTION_STATE_TYPE.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Registers a packet observer.
Call this method registers a packet observer. When the Agora SDK triggers IPacketObserver callbacks registered by for voice or video packet transmission, you can call this method to process the packets, such as encryption and decryption.
| observer | IPacketObserver. |
|
pure virtual |
Enables or disables the built-in encryption.
After the user leaves the channel, the SDK automatically disables the built-in encryption. To enable the built-in encryption, call this method before the user joins the channel again. Applicable scenarios: Scenarios with higher security requirements. Call timing: Call this method before joining a channel.
| enabled | Whether to enable built-in encryption:
|
| config | Built-in encryption configurations. See EncryptionConfig. |
IRtcEngine instance before calling this method.
|
pure virtual |
Creates a data stream.
You can call this method to create a data stream and improve the reliability and ordering of data transmission. Call timing: You can call this method either before or after joining a channel. Related callbacks: After setting reliable to true, if the recipient does not receive the data within five seconds, the SDK triggers the onStreamMessageError callback and returns an error code.
IRtcEngine. The data stream will be destroyed when leaving the channel, and the data stream needs to be recreated if needed. If you need a more comprehensive solution for low-latency, high-concurrency, and scalable real-time messaging and status synchronization, it is recommended to use Signaling.| streamId | An output parameter; the ID of the data stream created. |
| reliable | Sets whether the recipients are guaranteed to receive the data stream within five seconds:
|
| ordered | Sets whether the recipients receive the data stream in the sent order:
|
|
pure virtual |
Creates a data stream.
Compared to createDataStream(int* streamId, bool reliable, bool ordered), this method does not guarantee the reliability of data transmission. If a data packet is not received five seconds after it was sent, the SDK directly discards the data. Call timing: You can call this method either before or after joining a channel.
IRtcEngine. The data stream will be destroyed when leaving the channel, and the data stream needs to be recreated if needed. If you need a more comprehensive solution for low-latency, high-concurrency, and scalable real-time messaging and status synchronization, it is recommended to use Signaling.| streamId | An output parameter; the ID of the data stream created. |
| config | The configurations for the data stream. See DataStreamConfig. |
|
pure virtual |
Sends data stream messages.
After calling createDataStream(int* streamId, const DataStreamConfig& config), you can call this method to send data stream messages to all users in the channel. The SDK has the following restrictions on this method:
onStreamMessage callback on the remote client, from which the remote user gets the stream message. A failed method call triggers the onStreamMessageError callback on the remote client.Signaling.createDataStream(int* streamId, const DataStreamConfig& config) and joining the channel.| streamId | The data stream ID. You can get the data stream ID by calling createDataStream(int* streamId, const DataStreamConfig& config) |
| data | The message to be sent. |
| length | The length of the data. |
|
pure virtual |
Send Reliable message to remote uid in channel.
@technical preview
| uid | remote user id. |
| type | Reliable Data Transmission tunnel message type. See RdtStreamType |
| data | The pointer to the sent data. |
| length | The length of the sent data. |
|
pure virtual |
Send media control message.
@technical preview
| uid | Remote user id. In particular, if the uid is set to 0, it means broadcasting the message to the entire channel. |
| data | The pointer to the sent data. |
| length | The length of the sent data, max 1024. |
|
pure virtual |
Adds a watermark image to the local video.
This method adds a PNG watermark image to the local video stream in a live streaming session. Once the watermark image is added, all the users in the channel (CDN audience included) and the video capturing device can see and capture it. If you only want to add a watermark to the CDN live streaming, see startRtmpStreamWithTranscoding.
| watermark | The watermark image to be added to the local live streaming: RtcImage. |
|
pure virtual |
Adds a watermark image to the local video.
This method adds a PNG watermark image to the local video in the live streaming. Once the watermark image is added, all the audience in the channel (CDN audience included), and the capturing device can see and capture it. The Agora SDK supports adding only one watermark image onto a live video stream. The newly added watermark image replaces the previous one. The watermark coordinates are dependent on the settings in the setVideoEncoderConfiguration method:
ORIENTATION_MODE ) is fixed landscape mode or the adaptive landscape mode, the watermark uses the landscape orientation.ORIENTATION_MODE ) is fixed portrait mode or the adaptive portrait mode, the watermark uses the portrait orientation.setVideoEncoderConfiguration method; otherwise, the watermark image will be cropped. You can control the visibility of the watermark during preview by setting the visibleInPreview parameter when calling this method. However, whether it ultimately takes effect also depends on the position parameter you set when calling setupLocalVideo (the position of the video frame in the video link). Refer to the table below for details.| Observation position | visibleInPreview value | Watermark visibility | | -------------------------------— | -------------------— | -----------------— | | (Default) POSITION_POST_CAPTURER | true | Yes | | | false | No | | POSITION_PRE_ENCODER | true | Yes | | | false | Yes |enableVideo.startRtmpStreamWithTranscoding method.| 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 | The options of the watermark image to be added. See WatermarkOptions. |
|
pure virtual |
Adds a watermark image to the local video.
You can use this method to overlay a watermark image on the local video stream, and configure the watermark's position, size, and visibility in the preview using WatermarkConfig.
| configs | Watermark configuration. See WatermarkConfig. |
|
pure virtual |
Removes the watermark image from the local video.
This method removes a previously added watermark image from the local video stream using the specified unique ID.
| id | The ID of the watermark to be removed. This value should match the ID used when the watermark was added. |
|
pure virtual |
Enables interoperability with the Agora Web SDK (applicable only in the live streaming.
You can call this method to enable or disable interoperability with the Agora Web SDK. If a channel has Web SDK users, ensure that you call this method, or the video of the Native user will be a black screen for the Web user. This method is only applicable in live streaming scenarios, and interoperability is enabled by default in communication scenarios.
| enabled | Whether to enable interoperability:
|
|
pure virtual |
Reports customized messages.
Agora supports reporting and analyzing customized messages. This function is in the beta stage with a free trial. The ability provided in its beta test version is reporting a maximum of 10 message pieces within 6 seconds, with each message piece not exceeding 256 bytes and each string not exceeding 100 bytes. To try out this function, contact support@agora.io and discuss the format of customized messages with us.
|
pure virtual |
Registers the metadata observer.
You need to implement the IMetadataObserver class and specify the metadata type in this method. This method enables you to add synchronized metadata in the video stream for more diversified live interactive streaming, such as sending shopping links, digital coupons, and online quizzes. A successful call of this method triggers the getMaxMetadataSize callback.
joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options).| observer | The metadata observer. See IMetadataObserver. |
| type | The metadata type. The SDK currently only supports VIDEO_METADATA. See METADATA_TYPE. |
|
pure virtual |
Unregisters the specified metadata observer.
| observer | The metadata observer. See IMetadataObserver. |
| type | The metadata type. The SDK currently only supports VIDEO_METADATA. See METADATA_TYPE. |
|
pure virtual |
Start audio frame dump.
Optional location is: "pre_apm_proc", "apm", "pre_send_proc", "filter", "enc", "tx_mixer", "at_record", "atw_record" for audio sending. "dec", "mixed", "play", "rx_mixer", "playback_mixer", "pcm_source_playback_mixer", "pre_play_proc", "at_playout", "atw_playout" for audio receiving.
|
pure virtual |
Stops the audio frame dump.
|
pure virtual |
Sets whether to enable the AI noise suppression function and set the noise suppression mode.
You can call this method to enable AI noise suppression function. Once enabled, the SDK automatically detects and reduces stationary and non-stationary noise from your audio on the premise of ensuring the quality of human voice. Stationary noise refers to noise signal with constant average statistical properties and negligibly small fluctuations of level within the period of observation. Common sources of stationary noises are:
libagora_ai_noise_suppression_extension.dll. If the dynamic library is deleted, the function cannot be enabled.| enabled | Whether to enable the AI noise suppression function:
|
| mode | The AI noise suppression modes. See AUDIO_AINS_MODE. |
|
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 registration is successful, the user account can identify the identity of the local user, and the user can use it to join the channel. This method is optional. If you want to join a channel using a user account, you can choose one of the following methods:
registerLocalUserAccount method to register a user account, and then call the joinChannelWithUserAccount(const char* token, const char* channelId, const char* userAccount) or joinChannelWithUserAccount(const char* token, const char* channelId, const char* userAccount, const ChannelMediaOptions& options) method to join a channel, which can shorten the time it takes to enter the channel.joinChannelWithUserAccount(const char* token, const char* channelId, const char* userAccount) or joinChannelWithUserAccount(const char* token, const char* channelId, const char* userAccount, const ChannelMediaOptions& options) method to join a channel. Related callbacks: After successfully calling this method, the onLocalUserRegistered callback will be triggered on the local client to report the local user's UID and user account.userAccount used when registering a User Account. If you want to join a channel with the original String userAccount used during registration, call the joinChannelWithUserAccount(const char* token, const char* channelId, const char* userAccount, const ChannelMediaOptions& options) method to join the channel, instead of calling joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options) and pass in the Int UID obtained through this methoduserAccount is unique in the channel.| appId | The App ID of your project on Agora Console. |
| userAccount | The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as NULL. Supported characters are as follow(89 in total):
|
|
pure virtual |
Joins a channel with a User Account and Token.
Before calling this method, if you have not called registerLocalUserAccount to register a user account, when you call this method to join a channel, the SDK automatically creates a user account for you. Calling the registerLocalUserAccount method to register a user account, and then calling this method to join a channel can shorten the time it takes to enter the channel. Once a 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 billings. To stop subscribing to a specified stream or all remote streams, call the corresponding mute methods. Call timing: Call this method after initialize. Related callbacks: After the user successfully joins the channel, the SDK triggers the following callbacks:
onLocalUserRegistered, onJoinChannelSuccess and onConnectionStateChanged callbacks.onUserJoined and onUserInfoUpdated callbacks if a user joins the channel in the COMMUNICATION profile, or if a host joins the channel in the LIVE_BROADCASTING profile.initialize method; otherwise, you may fail to join the channel with the token. To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a UID, then ensure all the other users use the UID too. The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the ID of the user is set to the same parameter type.| token | The token generated on your server for authentication. See .Note:
|
| channelId | The channel name. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters (89 characters in total):
|
| userAccount | The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as NULL. Supported characters are as follows(89 in total):
|
uid parameter is not set to an integer, or the value of a member in ChannelMediaOptions is invalid. You need to pass in a valid parameter and join the channel again.IRtcEngine object. You need to reinitialize the IRtcEngine object.IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.IRtcEngine object is wrong. The typical cause is that after calling startEchoTest to start a call loop test, you call this method to join the channel without calling stopEchoTest to stop the test. You need to call stopEchoTest before calling this method.onConnectionStateChanged callback to see whether the user is in the channel. Do not call this method to join the channel unless you receive the CONNECTION_STATE_DISCONNECTED (1) state.channelId to rejoin the channel.uid to rejoin the channel.
|
pure virtual |
Join a channel using a user account and token, and set the media options.
Before calling this method, if you have not called registerLocalUserAccount to register a user account, when you call this method to join a channel, the SDK automatically creates a user account for you. Calling the registerLocalUserAccount method to register a user account, and then calling this method to join a channel can shorten the time it takes to enter the channel. Compared to joinChannelWithUserAccount(const char* token, const char* channelId, const char* userAccount), this method has the options parameter which is used to set media options, such as whether to publish audio and video streams within a channel. By default, the user subscribes to the audio and video streams of all the other users in the channel, giving rise to usage and billings. To stop subscribing to other streams, set the options parameter or call the corresponding mute methods. Call timing: Call this method after initialize. Related callbacks: After the user successfully joins the channel, the SDK triggers the following callbacks:
onLocalUserRegistered, onJoinChannelSuccess and onConnectionStateChanged callbacks.onUserJoined and onUserInfoUpdated callbacks if a user joins the channel in the COMMUNICATION profile, or if a host joins the channel in the LIVE_BROADCASTING profile.initialize method; otherwise, you may fail to join the channel with the token. To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a UID, then ensure all the other users use the UID too. The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the ID of the user is set to the same parameter type.| token | The token generated on your server for authentication. See .Note:
|
| channelId | The channel name. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters (89 characters in total):
|
| userAccount | The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as NULL. Supported characters are as follows(89 in total):
|
| options | The channel media options. See ChannelMediaOptions. |
uid parameter is not set to an integer, or the value of a member in ChannelMediaOptions is invalid. You need to pass in a valid parameter and join the channel again.IRtcEngine object. You need to reinitialize the IRtcEngine object.IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.IRtcEngine object is wrong. The typical cause is that after calling startEchoTest to start a call loop test, you call this method to join the channel without calling stopEchoTest to stop the test. You need to call stopEchoTest before calling this method.onConnectionStateChanged callback to see whether the user is in the channel. Do not call this method to join the channel unless you receive the CONNECTION_STATE_DISCONNECTED (1) state.channelId to rejoin the channel.uid to rejoin the channel.
|
pure virtual |
Join a channel using a user account and token, and set the media options.
Before calling this method, if you have not called registerLocalUserAccount to register a user account, when you call this method to join a channel, the SDK automatically creates a user account for you. Calling the registerLocalUserAccount method to register a user account, and then calling this method to join a channel can shorten the time it takes to enter the channel. Once a 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 billings. If you want to stop subscribing to the media stream of other users, you can set the options parameter or call the corresponding mute method. Call timing: Call this method after initialize. Related callbacks: After the user successfully joins the channel, the SDK triggers the following callbacks:
onLocalUserRegistered, onJoinChannelSuccess and onConnectionStateChanged callbacks.onUserJoined and onUserInfoUpdated callbacks if a user joins the channel in the COMMUNICATION profile, or if a host joins the channel in the LIVE_BROADCASTING profile.initialize method; otherwise, you may fail to join the channel with the token. To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a UID, then ensure all the other users use the UID too. The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the ID of the user is set to the same parameter type.| token | The token generated on your server for authentication. See .Note:
|
| channelId | The channel name. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters (89 characters in total):
|
| userAccount | The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as NULL. Supported characters are as follows(89 in total):
|
| options | The channel media options. See ChannelMediaOptions. |
| eventHandler | The callback class of IRtcEngineEx. See IRtcEngineEventHandler. You can get the callback events of multiple channels through the eventHandler object passed in this parameter. |
uid parameter is not set to an integer, or the value of a member in ChannelMediaOptions is invalid. You need to pass in a valid parameter and join the channel again.IRtcEngine object. You need to reinitialize the IRtcEngine object.IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.IRtcEngine object is wrong. The typical cause is that after calling startEchoTest to start a call loop test, you call this method to join the channel without calling stopEchoTest to stop the test. You need to call stopEchoTest before calling this method.onConnectionStateChanged callback to see whether the user is in the channel. Do not call this method to join the channel unless you receive the CONNECTION_STATE_DISCONNECTED (1) state.channelId to rejoin the channel.uid to rejoin the channel.
|
pure virtual |
Gets the user information by passing in the user account.
After a remote user joins the channel, the SDK gets the UID and user account of the remote user, caches them in a mapping table object, and triggers the onUserInfoUpdated callback on the local client. After receiving the callback, you can call this method and pass in the user account to get the UID of the remote user from the UserInfo object. Call timing: Call this method after receiving the onUserInfoUpdated callback. Related callbacks: onUserInfoUpdated
| userAccount | The user account. |
| userInfo | Input and output parameter. The UserInfo object that identifies the user information.
|
|
pure virtual |
Gets the user information by passing in the user ID.
After a remote user joins the channel, the SDK gets the UID and user account of the remote user, caches them in a mapping table object, and triggers the onUserInfoUpdated callback on the local client. After receiving the callback, you can call this method and passi in the UID.to get the user account of the specified user from the UserInfo object. Call timing: Call this method after receiving the onUserInfoUpdated callback. Related callbacks: onUserInfoUpdated
| uid | The user ID. |
| userInfo | Input and output parameter. The UserInfo object that identifies the user information.
|
|
pure virtual |
Starts relaying media streams across channels or updates channels for media relay.
The first successful call to this method starts relaying media streams from the source channel to the destination channels. To relay the media stream to other channels, or exit one of the current media relays, you can call this method again to update the destination channels. This feature supports relaying media streams to a maximum of six destination channels. After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged callback, and this callback returns the state of the media stream relay. Common states are as follows:
onChannelMediaRelayStateChanged callback returns RELAY_STATE_RUNNING (2) and RELAY_OK (0), it means that the SDK starts relaying media streams from the source channel to the destination channel.onChannelMediaRelayStateChanged callback returns RELAY_STATE_FAILURE (3), an exception occurs during the media stream relay.technical support.| configuration | The configuration of the media stream relay. See ChannelMediaRelayConfiguration. |
|
pure virtual |
Stops the media stream relay. Once the relay stops, the host quits all the target channels.
After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged callback. If the callback reports RELAY_STATE_IDLE (0) and RELAY_OK (0), the host successfully stops the relay.
onChannelMediaRelayStateChanged callback with the RELAY_ERROR_SERVER_NO_RESPONSE (2) or RELAY_ERROR_SERVER_CONNECTION_LOST (8) status code. You can call the leaveChannel(const LeaveChannelOptions& options) method to leave the channel, and the media stream relay automatically stops.
|
pure virtual |
Pauses the media stream relay to all target channels.
After the cross-channel media stream relay starts, you can call this method to pause relaying media streams to all target channels; after the pause, if you want to resume the relay, call resumeAllChannelMediaRelay.
startOrUpdateChannelMediaRelay.
|
pure virtual |
Resumes the media stream relay to all target channels.
After calling the pauseAllChannelMediaRelay method, you can call this method to resume relaying media streams to all destination channels.
pauseAllChannelMediaRelay.
|
pure virtual |
Sets the audio profile of the audio streams directly pushed to the CDN by the host.
When you set the publishMicrophoneTrack or publishCustomAudioTrack in the DirectCdnStreamingMediaOptions as true to capture audios, you can call this method to set the audio profile.
| profile | The audio profile, including the sampling rate, bitrate, encoding mode, and the number of channels. See AUDIO_PROFILE_TYPE. |
|
pure virtual |
Sets the video profile of the media streams directly pushed to the CDN by the host.
This method only affects video streams captured by cameras or screens, or from custom video capture sources. That is, when you set publishCameraTrack or publishCustomVideoTrack in DirectCdnStreamingMediaOptions as true to capture videos, you can call this method to set the video profiles. If your local camera does not support the video resolution you set,the SDK automatically adjusts the video resolution to a value that is closest to your settings for capture, encoding or streaming, with the same aspect ratio as the resolution you set. You can get the actual resolution of the video streams through the onDirectCdnStreamingStats callback.
| config | Video profile. See VideoEncoderConfiguration.Note: During CDN live streaming, Agora only supports setting ORIENTATION_MODE as ORIENTATION_MODE_FIXED_LANDSCAPE or ORIENTATION_MODE_FIXED_PORTRAIT. |
|
pure virtual |
Starts pushing media streams to the CDN directly.
Aogra does not support pushing media streams to one URL repeatedly. Media options Agora does not support setting the value of publishCameraTrack and publishCustomVideoTrack as true, or the value of publishMicrophoneTrack and publishCustomAudioTrack as true at the same time. When choosing media setting options ( DirectCdnStreamingMediaOptions ), you can refer to the following examples: If you want to push audio and video streams captured by the host from a custom source, the media setting options should be set as follows:
publishCustomAudioTrack is set as true and call the pushAudioFrame methodpublishCustomVideoTrack is set as true and call the pushVideoFrame methodpublishCameraTrack is set as false (the default value)publishMicrophoneTrack is set as false (the default value) As of v4.2.0, Agora SDK supports audio-only live streaming. You can set publishCustomAudioTrack or publishMicrophoneTrack in DirectCdnStreamingMediaOptions as true and call pushAudioFrame to push audio streams.| eventHandler | See onDirectCdnStreamingStateChanged and onDirectCdnStreamingStats. |
| publishUrl | The CDN live streaming URL. |
| options | The media setting options for the host. See DirectCdnStreamingMediaOptions. |
|
pure virtual |
Stops pushing media streams to the CDN directly.
|
pure virtual |
Change the media source during the pushing
| options | The direct cdn streaming media options: DirectCdnStreamingMediaOptions. |
|
pure virtual |
Enables the virtual metronome.
beatsPerMinute you set in AgoraRhythmPlayerConfig. For example, if you set beatsPerMinute as 60, the SDK plays one beat every second. If the file duration exceeds the beat duration, the SDK only plays the audio within the beat duration.publishRhythmPlayerTrack in ChannelMediaOptions as true. Applicable scenarios: In music education, physical education and other scenarios, teachers usually need to use a metronome so that students can practice with the correct beat. The meter is composed of a downbeat and upbeats. The first beat of each measure is called a downbeat, and the rest are called upbeats. Call timing: This method can be called either before or after joining the channel. Related callbacks: After successfully calling this method, the SDK triggers the onRhythmPlayerStateChanged callback locally to report the status of the virtual metronome.| sound1 | The absolute path or URL address (including the filename extensions) of the file for the downbeat. For example, C:\music\audio.mp4. For the audio file formats supported by this method, see What formats of audio files does the Agora RTC SDK support. |
| sound2 | The absolute path or URL address (including the filename extensions) of the file for the upbeats. For example, C:\music\audio.mp4. For the audio file formats supported by this method, see What formats of audio files does the Agora RTC SDK support. |
| config | The metronome configuration. See AgoraRhythmPlayerConfig. |
sound1 and sound2.
|
pure virtual |
Disables the virtual metronome.
After calling startRhythmPlayer, you can call this method to disable the virtual metronome.
|
pure virtual |
Configures the virtual metronome.
startRhythmPlayer, you can call this method to reconfigure the virtual metronome.beatsPerMinute you set in AgoraRhythmPlayerConfig. For example, if you set beatsPerMinute as 60, the SDK plays one beat every second. If the file duration exceeds the beat duration, the SDK only plays the audio within the beat duration.publishRhythmPlayerTrack in ChannelMediaOptions as true. Call timing: This method can be called either before or after joining the channel. Related callbacks: After successfully calling this method, the SDK triggers the onRhythmPlayerStateChanged callback locally to report the status of the virtual metronome.| config | The metronome configuration. See AgoraRhythmPlayerConfig. |
|
pure virtual |
Takes a snapshot of a video stream.
This method takes a snapshot of a video stream from the specified user, generates a JPG image, and saves it to the specified path. Call timing: Call this method after joining a channel. Related callbacks: After a successful call of this method, the SDK triggers the onSnapshotTaken callback to report whether the snapshot is successfully taken, as well as the details for that snapshot.
ChannelMediaOptions.| uid | The user ID. Set uid as 0 if you want to take a snapshot of the local user's video. |
| filePath | The local path (including filename extensions) of the snapshot. For example:
|
|
pure virtual |
Takes a screenshot of the video at the specified observation point.
This method takes a snapshot of a video stream from the specified user, generates a JPG image, and saves it to the specified path. Call timing: Call this method after joining a channel. Related callbacks: After a successful call of this method, the SDK triggers the onSnapshotTaken callback to report whether the snapshot is successfully taken, as well as the details for that snapshot.
ChannelMediaOptions.| uid | The user ID. Set uid as 0 if you want to take a snapshot of the local user's video. |
| config | The configuration of the snaptshot. See SnapshotConfig. |
|
pure virtual |
Enables or disables video screenshot and upload.
When video screenshot and upload function is enabled, the SDK takes screenshots and uploads videos sent by local users based on the type and frequency of the module you set in ContentInspectConfig. After video screenshot and upload, the Agora server sends the callback notification to your app server in HTTPS requests and sends all screenshots to the third-party cloud storage service. Call timing: This method can be called either before or after joining the channel.
CONTENT_INSPECT_SUPERVISION ), the video screenshot and upload dynamic library libagora_content_inspect_extension.dll is required. Deleting this library disables the screenshot and upload feature.| enabled | Whether to enalbe video screenshot and upload:
|
| config | Screenshot and upload configuration. See ContentInspectConfig. |
|
pure virtual |
Adjusts the volume of the custom audio track played remotely.
If you want to change the volume of the audio played remotely, you need to call this method again.
createCustomAudioTrack method to create a custom audio track before calling this method.| trackId | The audio track ID. Set this parameter to the custom audio track ID returned in createCustomAudioTrack. |
| volume | The volume of the audio source. The value can range from 0 to 100. 0 means mute; 100 means the original volume. |
|
pure virtual |
Adjusts the volume of the custom audio track played locally.
If you want to change the volume of the audio to be played locally, you need to call this method again.
createCustomAudioTrack method to create a custom audio track before calling this method.| trackId | The audio track ID. Set this parameter to the custom audio track ID returned in createCustomAudioTrack. |
| volume | The volume of the audio source. The value can range from 0 to 100. 0 means mute; 100 means the original volume. |
|
pure virtual |
Sets up cloud proxy service.
When users' network access is restricted by a firewall, configure the firewall to allow specific IP addresses and ports provided by Agora; then, call this method to enable the cloud proxyType and set the cloud proxy type with the proxyType parameter. After successfully connecting to the cloud proxy, the SDK triggers the onConnectionStateChanged ( CONNECTION_STATE_CONNECTING, CONNECTION_CHANGED_SETTING_PROXY_SERVER ) callback. To disable the cloud proxy that has been set, call the setCloudProxy(NONE_PROXY). To change the cloud proxy type that has been set, call the setCloudProxy (NONE_PROXY) first, and then call the setCloudProxy to set the proxyType you want.
startAudioMixing(const char* filePath, bool loopback, int cycle, int startPos) method to play online music files in the HTTP protocol. The services for Media Push and cohosting across channels use the cloud proxy with the TCP protocol.| proxyType | The type of the cloud proxy. See CLOUD_PROXY_TYPE. This parameter is mandatory. The SDK reports an error if you do not pass in a value. |
|
pure virtual |
Configures the connection to Agora's Private Media Server access module.
After successfully deploying the Agora Private Media Server and integrating the 4.x RTC SDK on intranet clients, you can call this method to specify the Local Access Point and assign the access module to the SDK. Call timing: This method must be called before joining a channel.
contact sales to learn more and deploy the Agora Hybrid Cloud.| config | Local Access Point configuration. See LocalAccessPointConfiguration. |
Error Codes for details and resolution suggestions.
|
pure virtual |
Sets audio advanced options.
If you have advanced audio processing requirements, such as capturing and sending stereo audio, you can call this method to set advanced audio options.
joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options), enableAudio and enableLocalAudio.| options | The advanced options for audio. See AdvancedAudioOptions. |
|
pure virtual |
Sets audio-video synchronization for the sender.
A user may use two separate devices to send audio and video streams. To ensure audio and video are synchronized on the receiving end, you can call this method on the video sender and pass in the channel name and user ID of the audio sender. The SDK will use the timestamp of the audio stream as the reference to automatically adjust the video stream, ensuring audio-video synchronization even if the two sending devices are on different uplink networks (e.g., Wi-Fi and 4G).
| channelId | The channel name of the audio sender. |
| uid | The user ID of the audio sender. |
Error Codes for details and resolution suggestions.
|
pure virtual |
Sets whether to replace the current video feeds with images when publishing video streams.
When publishing video streams, you can call this method to replace the current video feeds with custom images. Once you enable this function, you can select images to replace the video feeds through the ImageTrackOptions parameter. If you disable this function, the remote users see the video feeds that you publish. Call timing: Call this method after joining a channel.
| enable | Whether to replace the current video feeds with custom images:
|
| options | Image configurations. See ImageTrackOptions. |
|
pure virtual |
Gets the current Monotonic Time of the SDK.
Monotonic Time refers to a monotonically increasing time series whose value increases over time. The unit is milliseconds. In custom video capture and custom audio capture scenarios, in order to ensure audio and video synchronization, Agora recommends that you call this method to obtain the current Monotonic Time of the SDK, and then pass this value into the timestamp parameter in the captured video frame ( VideoFrame ) and audio frame ( AudioFrame ). Call timing: This method can be called either before or after joining the channel.
|
pure virtual |
Gets the type of the local network connection.
You can use this method to get the type of network in use at any stage.
|
pure virtual |
Provides technical preview functionalities or special customizations by configuring the SDK with JSON options.
Contact technical support to get the JSON configuration method.
| parameters | Pointer to the set parameters in a JSON string. |
|
pure virtual |
Enables tracing the video frame rendering process.
The SDK starts tracing the rendering status of the video frames in the channel from the moment this method is successfully called and reports information about the event through the onVideoRenderingTracingResult callback. Applicable scenarios: Agora recommends that you use this method in conjunction with the UI settings (such as buttons and sliders) in your app to improve the user experience. For example, call this method when the user clicks the Join Channel button, and then get the time spent during the video frame rendering process through the onVideoRenderingTracingResult callback, so as to optimize the indicators accordingly.
joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options) to join the channel. You can call this method at an appropriate time according to the actual application scenario to set the starting position for tracking video rendering events.IRtcEngine is initialized.
|
pure virtual |
Enables audio and video frame instant rendering.
After successfully calling this method, the SDK enables the instant frame rendering mode, which can speed up the first frame rendering after the user joins the channel. Applicable scenarios: Agora recommends that you enable this mode for the audience in a live streaming scenario. Call timing: Call this method before joining a channel.
release to destroy the IRtcEngine object.IRtcEngine is initialized.
|
pure virtual |
Gets the current NTP (Network Time Protocol) time.
In the real-time chorus scenario, especially when the downlink connections are inconsistent due to network issues among multiple receiving ends, you can call this method to obtain the current NTP time as the reference time, in order to align the lyrics and music of multiple receiving ends and achieve chorus synchronization.
|
pure virtual |
Checks whether the device supports the specified advanced feature.
Checks whether the capabilities of the current device meet the requirements for advanced features such as virtual background and image enhancement. Applicable scenarios: Before using advanced features, you can check whether the current device supports these features based on the call result. This helps to avoid performance degradation or unavailable features when enabling advanced features on low-end devices. Based on the return value of this method, you can decide whether to display or enable the corresponding feature button, or notify the user when the device's capabilities are insufficient.
| type | The type of the advanced feature, see FeatureType. |
true: The current device supports the specified feature.false: The current device does not support the specified feature.
|
pure virtual |
send audio metadata
| metadata | The pointer of metadata |
| length | Size of metadata |
|
pure virtual |
Queries the HDR capability of the video module.
| videoModule | The video module. See VIDEO_MODULE_TYPE |
| capability | HDR capability of video module. See HDR_CAPABILITY |