Agora C++ API Reference for All Platforms
|
Inherits agora::base::IEngineBase.
Inherited by agora::rtc::IRtcEngineEx.
Public Member Functions | |
virtual void | release (bool sync=false)=0 |
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 | 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 | startEchoTest ()=0 |
virtual int | startEchoTest (int intervalInSeconds)=0 |
virtual int | stopEchoTest ()=0 |
virtual int | enableVideo ()=0 |
virtual int | disableVideo ()=0 |
virtual int | startPreview ()=0 |
virtual int | stopPreview ()=0 |
virtual int | startLastmileProbeTest (const LastmileProbeConfig &config)=0 |
virtual int | stopLastmileProbeTest ()=0 |
virtual int | setVideoEncoderConfiguration (const VideoEncoderConfiguration &config)=0 |
virtual int | setBeautyEffectOptions (bool enabled, const BeautyOptions &options)=0 |
virtual int | setupRemoteVideo (const VideoCanvas &canvas)=0 |
virtual int | setupLocalVideo (const VideoCanvas &canvas)=0 |
virtual int | enableAudio ()=0 |
virtual int | disableAudio ()=0 |
virtual int | setAudioProfile (AUDIO_PROFILE_TYPE profile, AUDIO_SCENARIO_TYPE scenario)=0 |
virtual int | setAudioProfile (AUDIO_PROFILE_TYPE profile)=0 |
virtual int | enableLocalAudio (bool enabled)=0 |
virtual int | muteLocalAudioStream (bool mute)=0 |
virtual int | muteAllRemoteAudioStreams (bool mute)=0 |
virtual int | setDefaultMuteAllRemoteAudioStreams (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 | setDefaultMuteAllRemoteVideoStreams (bool mute)=0 |
virtual int | muteRemoteVideoStream (uid_t uid, bool mute)=0 |
virtual int | setRemoteVideoStreamType (uid_t uid, VIDEO_STREAM_TYPE streamType)=0 |
virtual int | setRemoteDefaultVideoStreamType (VIDEO_STREAM_TYPE streamType)=0 |
virtual int | enableAudioVolumeIndication (int interval, int smooth)=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 AudioFileRecordingConfig &config)=0 |
virtual int | registerAudioEncodedFrameObserver (const AudioEncodedFrameObserverConfig &config, IAudioEncodedFrameObserver *observer)=0 |
virtual int | stopAudioRecording ()=0 |
virtual int | destroyMediaPlayer (agora_refptr< IMediaPlayer > media_player)=0 |
virtual int | startAudioMixing (const char *filePath, bool loopback, bool replace, int cycle)=0 |
virtual int | stopAudioMixing ()=0 |
virtual int | pauseAudioMixing ()=0 |
virtual int | resumeAudioMixing ()=0 |
virtual int | adjustAudioMixingVolume (int volume)=0 |
virtual int | adjustAudioMixingPublishVolume (int volume)=0 |
virtual int | getAudioMixingPublishVolume ()=0 |
virtual int | adjustAudioMixingPlayoutVolume (int volume)=0 |
virtual int | getAudioMixingPlayoutVolume ()=0 |
virtual int | getAudioMixingDuration ()=0 |
virtual int | getAudioMixingCurrentPosition ()=0 |
virtual int | setAudioMixingPosition (int pos)=0 |
virtual int | getEffectsVolume ()=0 |
virtual int | setEffectsVolume (int volume)=0 |
virtual int | preloadEffect (int soundId, const char *filePath)=0 |
virtual int | playEffect (int soundId, const char *filePath, int loopCount, double pitch, double pan, int gain, bool publish=false)=0 |
virtual int | playAllEffects (int loopCount, double pitch, double pan, int gain, bool publish=false)=0 |
virtual int | getVolumeOfEffect (int soundId)=0 |
virtual int | setVolumeOfEffect (int soundId, int volume)=0 |
virtual int | pauseEffect (int soundId)=0 |
virtual int | pauseAllEffects ()=0 |
virtual int | resumeEffect (int soundId)=0 |
virtual int | resumeAllEffects ()=0 |
virtual int | stopEffect (int soundId)=0 |
virtual int | stopAllEffects ()=0 |
virtual int | unloadEffect (int soundId)=0 |
virtual int | unloadAllEffects ()=0 |
virtual int | enableSoundPositionIndication (bool enabled)=0 |
virtual int | setRemoteVoicePosition (uid_t uid, double pan, double gain)=0 |
virtual int | setVoiceBeautifierPreset (VOICE_BEAUTIFIER_PRESET preset)=0 |
virtual int | setAudioEffectPreset (AUDIO_EFFECT_PRESET preset)=0 |
virtual int | setVoiceConversionPreset (VOICE_CONVERSION_PRESET preset)=0 |
virtual int | setAudioEffectParameters (AUDIO_EFFECT_PRESET preset, int param1, int param2)=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 | setLocalVoicePitch (double pitch)=0 |
virtual int | setLocalVoiceEqualization (AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, int bandGain)=0 |
virtual int | setLocalVoiceReverb (AUDIO_REVERB_TYPE reverbKey, int value)=0 |
virtual int | setLocalVoiceReverbPreset (AUDIO_REVERB_PRESET reverbPreset)=0 |
virtual int | setLocalVoiceChanger (VOICE_CHANGER_PRESET voiceChanger)=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 | 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 | setLocalRenderMode (media::base::RENDER_MODE_TYPE renderMode)=0 |
virtual int | setLocalVideoMirrorMode (VIDEO_MIRROR_MODE_TYPE mirrorMode)=0 |
virtual int | enableDualStreamMode (bool enabled)=0 |
virtual int | enableDualStreamMode (VIDEO_SOURCE_TYPE sourceType, bool enabled)=0 |
virtual int | enableDualStreamMode (VIDEO_SOURCE_TYPE sourceType, bool enabled, const SimulcastStreamConfig &streamConfig)=0 |
virtual int | setExternalAudioSource (bool enabled, int sampleRate, int channels, int sourceNumber=1, bool localPlayback=false, bool publish=true)=0 |
virtual int | setExternalAudioSink (int sampleRate, int channels)=0 |
virtual int | pullAudioFrame (media::IAudioFrameObserver::AudioFrame *frame)=0 |
virtual int | startPrimaryCustomAudioTrack (const AudioTrackConfig &config)=0 |
virtual int | stopPrimaryCustomAudioTrack ()=0 |
virtual int | startSecondaryCustomAudioTrack (const AudioTrackConfig &config)=0 |
virtual int | stopSecondaryCustomAudioTrack ()=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 | setPlaybackAudioFrameBeforeMixingParameters (int sampleRate, int channel)=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 (unsigned int uid, int volume)=0 |
virtual int | enableLoopbackRecording (bool enabled)=0 |
virtual int | adjustLoopbackRecordingVolume (int volume)=0 |
virtual int | getLoopbackRecordingVolume ()=0 |
virtual int | enableInEarMonitoring (bool enabled, int includeAudioFilters)=0 |
virtual int | setInEarMonitoringVolume (int volume)=0 |
virtual int | loadExtensionProvider (const char *extension_lib_path)=0 |
virtual int | enableExtension (const char *provider_name, const char *extension_name, bool enable=true)=0 |
virtual int | setExtensionProperty (const char *provider_name, const char *extension_name, const char *key, const char *json_value)=0 |
virtual int | getExtensionProperty (const char *provider_name, const char *extension_name, const char *key, char *json_value, int buf_len)=0 |
virtual int | setCameraCapturerConfiguration (const CameraCapturerConfiguration &config)=0 |
virtual int | switchCamera ()=0 |
virtual bool | isCameraZoomSupported ()=0 |
virtual bool | isCameraFaceDetectSupported ()=0 |
virtual bool | isCameraTorchSupported ()=0 |
virtual bool | isCameraFocusSupported ()=0 |
virtual bool | isCameraAutoFocusFaceModeSupported ()=0 |
virtual int | setCameraZoomFactor (float factor)=0 |
virtual int | enableFaceDetection (bool enabled)=0 |
virtual float | getCameraMaxZoomFactor ()=0 |
virtual int | setCameraFocusPositionInPreview (float positionX, float positionY)=0 |
virtual int | setCameraTorchOn (bool isOn)=0 |
virtual int | setCameraAutoFocusFaceModeEnabled (bool enabled)=0 |
virtual bool | isCameraExposurePositionSupported ()=0 |
virtual int | setCameraExposurePosition (float positionXinView, float positionYinView)=0 |
virtual bool | isCameraAutoExposureFaceModeSupported ()=0 |
virtual int | setCameraAutoExposureFaceModeEnabled (bool enabled)=0 |
virtual int | setDefaultAudioRouteToSpeakerphone (bool defaultToSpeaker)=0 |
virtual int | setEnableSpeakerphone (bool speakerOn)=0 |
virtual bool | isSpeakerphoneEnabled ()=0 |
virtual int | startScreenCaptureByDisplayId (unsigned int displayId, const Rectangle ®ionRect, const ScreenCaptureParameters &captureParams)=0 |
virtual int | startScreenCaptureByScreenRect (const Rectangle &screenRect, const Rectangle ®ionRect, const ScreenCaptureParameters &captureParams)=0 |
virtual int | startScreenCapture (void *mediaProjectionPermissionResultData, const ScreenCaptureParameters &captureParams)=0 |
virtual int | startScreenCaptureByWindowId (view_t windowId, const Rectangle ®ionRect, const ScreenCaptureParameters &captureParams)=0 |
virtual int | setScreenCaptureContentHint (VIDEO_CONTENT_HINT contentHint)=0 |
virtual int | updateScreenCaptureRegion (const Rectangle ®ionRect)=0 |
virtual int | updateScreenCaptureParameters (const ScreenCaptureParameters &captureParams)=0 |
virtual int | stopScreenCapture ()=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 | addPublishStreamUrl (const char *url, bool transcodingEnabled)=0 |
virtual int | removePublishStreamUrl (const char *url)=0 |
virtual int | setLiveTranscoding (const LiveTranscoding &transcoding)=0 |
virtual int | startLocalVideoTranscoder (const LocalTranscoderConfiguration &config)=0 |
virtual int | updateLocalTranscoderConfiguration (const LocalTranscoderConfiguration &config)=0 |
virtual int | stopLocalVideoTranscoder ()=0 |
virtual int | startPrimaryCameraCapture (const CameraCapturerConfiguration &config)=0 |
virtual int | startSecondaryCameraCapture (const CameraCapturerConfiguration &config)=0 |
virtual int | stopPrimaryCameraCapture ()=0 |
virtual int | stopSecondaryCameraCapture ()=0 |
virtual int | setCameraDeviceOrientation (VIDEO_SOURCE_TYPE type, VIDEO_ORIENTATION orientation)=0 |
virtual int | setScreenCaptureOrientation (VIDEO_SOURCE_TYPE type, VIDEO_ORIENTATION orientation)=0 |
virtual int | startPrimaryScreenCapture (const ScreenCaptureConfiguration &config)=0 |
virtual int | startSecondaryScreenCapture (const ScreenCaptureConfiguration &config)=0 |
virtual int | stopPrimaryScreenCapture ()=0 |
virtual int | stopSecondaryScreenCapture ()=0 |
virtual CONNECTION_STATE_TYPE | getConnectionState ()=0 |
virtual bool | registerEventHandler (IRtcEngineEventHandler *eventHandler)=0 |
virtual bool | unregisterEventHandler (IRtcEngineEventHandler *eventHandler)=0 |
virtual int | setRemoteUserPriority (uid_t uid, PRIORITY_TYPE userPriority)=0 |
virtual int | registerPacketObserver (IPacketObserver *observer)=0 |
virtual int | setEncryptionMode (const char *encryptionMode)=0 |
virtual int | setEncryptionSecret (const char *secret)=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, DataStreamConfig &config)=0 |
virtual int | sendStreamMessage (int streamId, const char *data, size_t length)=0 |
virtual int | addVideoWatermark (const RtcImage &watermark)=0 |
virtual int | addVideoWatermark (const char *watermarkUrl, const WatermarkOptions &options)=0 |
virtual int | clearVideoWatermark ()=0 |
virtual int | clearVideoWatermarks ()=0 |
virtual int | addInjectStreamUrl (const char *url, const InjectStreamConfig &config)=0 |
virtual int | removeInjectStreamUrl (const char *url)=0 |
virtual int | pauseAudio ()=0 |
virtual int | resumeAudio ()=0 |
virtual int | enableWebSdkInteroperability (bool enabled)=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 user_id, 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 user_id, const char *location)=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, const char *channelId=NULL, const char *localUserAccount=NULL)=0 |
virtual int | getUserInfoByUid (uid_t uid, rtc::UserInfo *userInfo, const char *channelId=NULL, const char *localUserAccount=NULL)=0 |
virtual int | startChannelMediaRelay (const ChannelMediaRelayConfiguration &configuration)=0 |
virtual int | updateChannelMediaRelay (const ChannelMediaRelayConfiguration &configuration)=0 |
virtual int | stopChannelMediaRelay ()=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 | pushDirectCdnStreamingCustomVideoFrame (media::base::ExternalVideoFrame *frame)=0 |
![]() | |
virtual | ~IEngineBase () |
The IRtcEngine class.
This class provides the main methods that can be invoked by your app.
IRtcEngine is the basic interface class of the Agora Native SDK. Creating an IRtcEngine object and then calling the methods of this object enables you to use Agora Native SDK's communication functionality.
|
pure virtual |
Releases the IRtcEngine object.
sync | Determines whether this method is a synchronous call.
|
|
pure virtual |
Initializes the Agora SDK service.
In this method, you need to enter the issued Agora App ID to start initialization. After creating an IRtcEngine object, call this method to initialize the service before calling any other methods. After the initialization, the service is set to enable audio by default.
context | The RtcEngineContext object. |
|
pure virtual |
Implements agora::base::IEngineBase.
|
pure virtual |
Gets the SDK version.
build | The build number. |
|
pure virtual |
Gets the warning or error description.
code | The warning or error code. |
|
pure virtual |
Joins a channel.
Users in the same channel can talk to each other; and multiple users in the same channel can start a group chat. Note that users using different App IDs cannot call each other.
uid
s, that is, two users with the same uid. If you set uid
as 0, the system automatically assigns a user ID.token | The token for authentication.
|
channelId | The unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
|
info | (Optional) Additional information about the channel that you want to add. It can be set as a NULL string or channel related information. Other users in the channel will not receive this message. |
uid | (Optional) User ID: A 32-bit unsigned integer ranging from 1 to (2^32-1). It must be unique. If not assigned (or set to 0), the SDK assigns one and reports it in the onJoinChannelSuccess callback. Your app must record and maintain the returned value as the SDK does not maintain it. |
|
pure virtual |
Joins a channel with media options.
Users in the same channel can talk to each other; and multiple users in the same channel can start a group chat. Note that users using different App IDs cannot call each other.
uid
s, that is, two users with the same uid. If you set uid
as 0, the system automatically assigns a user ID.token | The token for authentication.
|
channelId | The unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
|
uid | (Optional) User ID: A 32-bit unsigned integer ranging from 1 to (2^32-1). It must be unique. If not assigned (or set to 0), the SDK assigns one and reports it in the onJoinChannelSuccess callback. Your app must record and maintain the returned value as the SDK does not maintain it. |
options | The channel media options: ChannelMediaOptions. |
|
pure virtual |
Updates the channel media options after joining the channel.
options | The channel media options: ChannelMediaOptions. |
|
pure virtual |
Leaves the channel.
This method allows a user to leave the channel, for example, by hanging up or exiting a call.
This method is an asynchronous call, which means that the result of this method returns even before the user has not actually left the channel. Once the user successfully leaves the channel, the SDK triggers the onLeaveChannel callback.
onLeaveChannel
callback.
|
pure virtual |
Leaves the channel.
options | The leave channel options. |
This method allows a user to leave the channel, for example, by hanging up or exiting a call.
This method is an asynchronous call, which means that the result of this method returns even before the user has not actually left the channel. Once the user successfully leaves the channel, the SDK triggers the onLeaveChannel callback.
onLeaveChannel
callback.
|
pure virtual |
Renews the token.
Once a token is enabled and used, it expires after a certain period of time.
Under the following circumstances, generate a new token on your server, and then call this method to renew it. Failure to do so results in the SDK disconnecting from the server.
ERR_TOKEN_EXPIRED(-109)
error is reported.token | The new token. |
|
pure virtual |
Sets the channel profile.
The IRtcEngine differentiates channel profiles and applies different optimization algorithms accordingly. For example, it prioritizes smoothness and low latency for a video call, and prioritizes video quality for a video broadcast.
joinChannel
. You cannot set the channel profile once you have joined the channel.profile | The channel profile: CHANNEL_PROFILE_TYPE. |
|
pure virtual |
Sets the role of a user.
This method sets the user role as either BROADCASTER or AUDIENCE (default).
By default, all users are audience regardless of the channel profile. Call this method to change the user role to BROADCASTER so that the user can send a stream.
role | The role of the client: CLIENT_ROLE_TYPE. |
|
pure virtual |
Starts an audio call test.
This method launches an audio call test to determine whether the audio devices (for example, headset and speaker) and the network connection are working properly.
In the test, the user first speaks, and the recording is played back in 10 seconds. If the user can hear the recording in 10 seconds, it indicates that the audio devices and network connection work properly.
|
pure virtual |
Starts an audio call test.
This method starts an audio call test to determine whether the audio devices (for example, headset and speaker) and the network connection are working properly.
In the audio call test, you record your voice. If the recording plays back within the set time interval, the audio devices and the network connection are working properly.
LIVE_BROADCASTING
profile, only a host can call this method. intervalInSeconds | The time interval (s) between when you speak and when the recording plays back. |
|
pure virtual |
Stops the audio call test.
|
pure virtual |
Enables the video.
You can call this method either before joining a channel or during a call. If you call this method before entering a channel, the service starts the video; if you call it during a call, the audio call switches to a video call.
|
pure virtual |
Disables the video.
This method stops capturing the local video and receiving any remote video. To enable the local preview function, call enableLocalVideo (true).
|
pure virtual |
Starts the local video preview before joining a channel.
Once you call this method to start the local video preview, if you leave the channel by calling leaveChannel, the local video preview remains until you call stopPreview to disable it.
|
pure virtual |
Stops the local video preview and the video.
|
pure virtual |
Starts the last-mile network probe test.
This method starts the last-mile network probe test before joining a channel to get the uplink and downlink last-mile network statistics, including the bandwidth, packet loss, jitter, and round-trip time (RTT).
Call this method to check the uplink network quality before users join a channel or before an audience switches to a host. Once this method is enabled, the SDK returns the following callbacks:
config | Sets the configurations of the last-mile network probe test. See LastmileProbeConfig. |
|
pure virtual |
Stops the last-mile network probe test.
|
pure virtual |
Sets the video encoder configuration.
Each configuration profile corresponds to a set of video parameters, including the resolution, frame rate, and bitrate.
The parameters specified in this method are the maximum values under ideal network conditions. If the video engine cannot render the video using the specified parameters due to poor network conditions, the parameters further down the list are considered until a successful configuration is found.
config | The local video encoder configuration: VideoEncoderConfiguration. |
|
pure virtual |
Enables/Disables image enhancement and sets the options.
enabled | Sets whether or not to enable image enhancement:
|
options | Sets the image enhancement option. See BeautyOptions. |
|
pure virtual |
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.
Usually the app should specify the uid
of the remote video in the method call before the remote user joins the channel. If the remote uid
is unknown to the app, set it later when the app receives the onUserJoined callback.
To unbind the remote user from the view, set view
in VideoCanvas as null
.
canvas | The remote video view settings: VideoCanvas. |
|
pure virtual |
Initializes the local video view.
This method initializes the video view of the local stream on the local device. It affects only the video view that the local user sees, not the published local video stream.
To unbind the local video from the view, set view
in VideoCanvas as null
.
canvas | The local video view setting: VideoCanvas. |
|
pure virtual |
Enables the audio.
The audio is enabled by default.
|
pure virtual |
Disables the audio.
|
pure virtual |
Sets the audio parameters and application scenarios.
audioScenario
member in the RtcEngineContext struct.joinChannel
method.profile
as MUSIC_HIGH_QUALITY
(4) and scenario
as AUDIO_SCENARIO_GAME_STREAMING
(3).profile | Sets the sample rate, bitrate, encoding mode, and the number of channels: AUDIO_PROFILE_TYPE. |
scenario | Sets the audio application scenarios: AUDIO_SCENARIO_TYPE. |
|
pure virtual |
Sets the audio profile.
joinChannel
method.profile
as MUSIC_HIGH_QUALITY
(4).audioScenario
member in the RtcEngineContext struct.profile | The audio profile, such as the sample rate, bitrate and codec type: AUDIO_PROFILE_TYPE. |
|
pure virtual |
Enables or disables the local audio capture.
The audio function is enabled by default. This method disables or re-enables the local audio function, that is, to stop or restart local audio capture and processing.
This method does not affect receiving or playing the remote audio streams, and enableLocalAudio
(false) is applicable to scenarios where the user wants to receive remote audio streams without sending any audio stream to other users in the channel.
enabled | Determines whether to disable or re-enable the local audio function:
|
|
pure virtual |
Stops or resumes sending the local audio stream.
After calling this method successfully, the SDK triggers the onRemoteAudioStateChanged callback with the following parameters:
mute
is set as true
, this method does not disable the microphone, which does not affect any ongoing recording.setChannelProfile
method.mute | Determines whether to send or stop sending the local audio stream:
|
|
pure virtual |
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. You can call this method before, during, or after a call.
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:
|
|
pure virtual |
Determines whether to receive all remote audio streams by default.
joinChannel
Use this method to set whether to receive audio streams of subsequent peer users. Agora recommends calling it before joining a channel.
A successful call of setDefaultMuteAllRemoteAudioStreams(true) results in that the local user not receiving any audio stream after joining a channel.
mute | Whether to receive remote audio streams by default:
|
|
pure virtual |
Stops or resumes receiving the audio stream of a specified user.
uid | The ID of the specified user. |
mute | Whether to stop receiving the audio stream of the specified user:
|
|
pure virtual |
Stops or resumes sending the local video stream.
mute | Determines whether to send or stop sending the local video stream:
|
|
pure virtual |
Disables or re-enables the local video capture.
Once you enable the video using enableVideo, the local video is enabled by default. This method disables or re-enables the local video capture.
enableLocalVideo(false)
applies to scenarios when the user wants to watch the remote video without sending any video stream to the other user.
enableVideo
. Otherwise, this method may not work properly.enabled | Determines whether to disable or re-enable the local video, including the capturer, renderer, and sender:
|
|
pure virtual |
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. You can call this method before, during, or after a call.
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:
|
|
pure virtual |
Determines whether to receive all remote video streams by default.
joinChannel
.Use this method to set whether to receive video streams of subsequent peer users. Agora recommends calling it before joining a channel.
A successful call of setDefaultMuteAllRemoteVideoStreams(true) results in that the local user not receiving any video stream after joining a channel.
mute | Whether to receive remote video streams by default:
|
|
pure virtual |
Stops or resumes receiving the video stream of a specified user.
uid | The ID of the specified user. |
mute | Whether to stop receiving the video stream of the specified user:
|
|
pure virtual |
Sets the remote video stream type.
If the remote user has enabled the dual-stream mode, by default the SDK receives the high-stream video by Call this method to switch to the low-stream video.
uid | ID of the remote user sending the video stream. |
streamType | Sets the video stream type: VIDEO_STREAM_TYPE. |
|
pure virtual |
Sets the default stream type of the remote video if the remote user has enabled dual-stream.
streamType | Sets the default video stream type: VIDEO_STREAM_TYPE. |
|
pure virtual |
Enables the onAudioVolumeIndication
callback to report on which users are speaking and the speakers' volume.
Once the onAudioVolumeIndication callback is enabled, the SDK returns the volume indication in the at the time interval set in enableAudioVolumeIndication
, regardless of whether any user is speaking 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 range is [0, 10]. The greater the value, the more sensitive the indicator. The recommended value is 3. |
|
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.
filePath | Full file path of the recording file. The string of the file name is in UTF-8 code. |
quality | Sets the audio recording quality: AUDIO_RECORDING_QUALITY_TYPE. |
|
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.
filePath | Full file path of the recording file. The string of the file name is in UTF-8 code. |
sampleRate | Sample rate, value should be 16000, 32000, 44100, or 48000. |
quality | Sets the audio recording quality: AUDIO_RECORDING_QUALITY_TYPE. |
|
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 |
register encoded audio frame observer
|
pure virtual |
Stops the audio recording on the client.
The recording automatically stops when the leaveChannel() method is called.
|
pure virtual |
|
pure virtual |
Starts playing and mixing the music file.
This method mixes the specified local audio file with the audio stream from the microphone, or replaces the microphone's audio stream with the specified local audio file. You can choose whether the other user can hear the local audio playback and specify the number of playback loops. This method also supports online music playback.
After calling this method successfully, the SDK triggers the
onAudioMixingStateChanged (PLAY) callback on the local client. When the audio mixing file playback finishes after calling this method, the SDK triggers the onAudioMixingStateChanged (STOPPED) callback on the local client.
AUDIO_MIXING_ERROR_TOO_FREQUENT_CALL(702)
error code occurs.filePath | Pointer to the absolute path (including the suffixes of the filename) of the local or online audio file to mix, for example, c:/music/au dio.mp4. Supported audio formats: 3GP, ASF, ADTS, AVI, MP3, MP4, MPEG-4, SAMI, and WAVE. |
loopback | Sets which user can hear the audio mixing:
|
replace | Sets the audio mixing content:
|
cycle | Sets the number of playback loops:
|
|
pure virtual |
Stops playing and mixing the music file.
Call this method when you are in a channel.
|
pure virtual |
Pauses playing and mixing the music file.
Call this method when you are in a channel.
|
pure virtual |
Resumes playing and mixing the music file.
Call this method when you are in a channel.
|
pure virtual |
Adjusts the volume during audio mixing.
Call this method when you are in a channel.
volume | The audio mixing volume. The value ranges between 0 and 100 (default). |
|
pure virtual |
Adjusts the audio mixing volume for publishing (for remote users).
volume | Audio mixing volume for publishing. The value ranges between 0 and 100 (default). |
|
pure virtual |
Retrieves the audio mixing volume for publishing. This method helps troubleshoot audio volume related issues.
|
pure virtual |
Adjusts the audio mixing volume for local playback.
volume | Audio mixing volume for local playback. The value ranges between 0 and 100 (default). |
|
pure virtual |
Retrieves the audio mixing volume for local playback. This method helps troubleshoot audio volume related issues.
|
pure virtual |
Gets the duration (ms) of the music file.
Call this API when you are in a channel.
|
pure virtual |
Gets the playback position (ms) of the music file.
Call this method when you are in a channel.
|
pure virtual |
Sets the playback position of the music file to a different starting position (the default plays from the beginning).
pos | The playback starting position (ms) of the audio mixing file. |
|
pure virtual |
Gets the volume of audio effects.
|
pure virtual |
Sets the volume of audio effects.
volume | The volume of audio effects. The value ranges between 0 and 100 (original volume). |
|
pure virtual |
Preloads a specified audio effect.
This method preloads only one specified audio effect into the memory each time it is called. To preload multiple audio effects, call this method multiple times.
After preloading, you can call playEffect to play the preloaded audio effect or call playAllEffects to play all the preloaded audio effects.
soundId | The ID of the audio effect. |
filePath | The absolute path of the local audio effect file or the URL of the online audio effect file. Supported audio formats: mp3, mp4, m4a, aac, 3gp, mkv, and wav. |
|
pure virtual |
Plays a specified audio effect.
After calling preloadEffect, you can call this method to play the specified audio effect for all users in the channel.
This method plays only one specified audio effect each time it is called. To play multiple audio effects, call this method multiple times.
soundId | The ID of the audio effect. |
filePath | The absolute path of the local audio effect file or the URL of the online audio effect file. Supported audio formats: mp3, mp4, m4a, aac, 3gp, mkv, and wav. |
loopCount | The number of times the audio effect loops:
|
pitch | The pitch of the audio effect. The value ranges between 0.5 and 2.0. The default value is 1.0 (original pitch). The lower the value, the lower the pitch. |
pan | The spatial position of the audio effect. The value ranges between -1.0 and 1.0:
|
gain | The volume of the audio effect. The value ranges between 0 and 100. The default value is 100 (original volume). The lower the value, the lower the volume of the audio effect. |
publish | Sets whether to publish the audio effect to the remote:
|
|
pure virtual |
Plays all audio effects.
After calling preloadEffect multiple times to preload multiple audio effects into the memory, you can call this method to play all the specified audio effects for all users in the channel.
loopCount | The number of times the audio effect loops:
|
pitch | The pitch of the audio effect. The value ranges between 0.5 and 2.0. The default value is 1.0 (original pitch). The lower the value, the lower the pitch. |
pan | The spatial position of the audio effect. The value ranges between -1.0 and 1.0:
|
gain | The volume of the audio effect. The value ranges between 0 and 100. The default value is 100 (original volume). The lower the value, the lower the volume of the audio effect. |
publish | Sets whether to publish the audio effect to the remote:
|
|
pure virtual |
Gets the volume of the specified audio effect.
soundId | The ID of the audio effect. |
|
pure virtual |
Sets the volume of the specified audio effect.
soundId | The ID of the audio effect. |
volume | The volume of the specified audio effect. The value ranges between 0 and 100 (original volume). |
|
pure virtual |
Pauses playing the specified audio effect.
soundId | The ID of the audio effect. |
|
pure virtual |
Pauses playing audio effects.
|
pure virtual |
Resumes playing the specified audio effect.
soundId | The ID of the audio effect. |
|
pure virtual |
Resumes playing audio effects.
|
pure virtual |
Stops playing the specified audio effect.
soundId | The ID of the audio effect. |
|
pure virtual |
Stops playing audio effects.
|
pure virtual |
Releases the specified preloaded audio effect from the memory.
soundId | The ID of the audio effect. |
|
pure virtual |
Releases preloaded audio effects from the memory.
|
pure virtual |
Enables/Disables stereo panning for remote users.
Ensure that you call this method before joinChannel to enable stereo panning for remote users so that the local user can track the position of a remote user by calling setRemoteVoicePosition.
enabled | Sets whether or not to enable stereo panning for remote users:
|
|
pure virtual |
Sets the sound position and gain of a remote user.
When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, such as Battle Royale games.
uid | The ID of the remote user. |
pan | The sound position of the remote user. The value ranges from -1.0 to 1.0:
|
gain | Gain of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original gain of the remote user). The smaller the value, the less the gain. |
|
pure virtual |
Sets an SDK preset voice beautifier effect.
Call this method to set an SDK preset voice beautifier effect for the local user who sends an audio stream. After setting a voice beautifier effect, all users in the channel can hear the effect.
You can set different voice beautifier effects for different scenarios. See Set the Voice Beautifier and Audio Effects.
To achieve better audio effect quality, Agora recommends calling setAudioProfile and setting the scenario
parameter to AUDIO_SCENARIO_GAME_STREAMING(3)
and the profile
parameter to AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)
or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)
before calling this method.
profile
parameter of setAudioProfile to AUDIO_PROFILE_SPEECH_STANDARD(1)
or AUDIO_PROFILE_IOT(6)
; otherwise, this method call fails.preset | The options for SDK preset voice beautifier effects: VOICE_BEAUTIFIER_PRESET. |
|
pure virtual |
Sets an SDK preset audio effect.
Call this method to set an SDK preset audio effect for the local user who sends an audio stream. This audio effect does not change the gender characteristics of the original voice. After setting an audio effect, all users in the channel can hear the effect.
You can set different audio effects for different scenarios. See Set the Voice Beautifier and Audio Effects.
To achieve better audio effect quality, Agora recommends calling setAudioProfile and setting the scenario
parameter to AUDIO_SCENARIO_GAME_STREAMING(3)
before calling this method.
parameter
of setAudioProfile
to AUDIO_PROFILE_SPEECH_STANDARD(1)
or AUDIO_PROFILE_IOT(6)
; otherwise, this method call fails.preset
parameter to enumerators except ROOM_ACOUSTICS_3D_VOICE
or PITCH_CORRECTION
, do not call setAudioEffectParameters; otherwise, setAudioEffectParameters
overrides this method.setAudioEffectPreset
:
preset | The options for SDK preset audio effects. See AUDIO_EFFECT_PRESET. |
|
pure virtual |
Sets an SDK preset voice conversion.
Call this method to set an SDK preset voice conversion for the local user who sends an audio stream. After setting an voice conversion, all users in the channel can hear the effect.
You can set different voice conversion for different scenarios. See Set the Voice Beautifier and Audio Effects.
To achieve better voice conversion quality, Agora recommends calling setAudioProfile and setting the scenario
parameter to AUDIO_SCENARIO_GAME_STREAMING(3)
before calling this method.
parameter
of setAudioProfile
to AUDIO_PROFILE_SPEECH_STANDARD(1)
or AUDIO_PROFILE_IOT(6)
; otherwise, this method call fails.preset
parameter to enumerators,setVoiceConversionPreset
:
preset | The options for SDK preset voice conversion. See VOICE_CONVERSION_PRESET. |
|
pure virtual |
Sets parameters for SDK preset audio effects.
Call this method to set the following parameters for the local user who send an audio stream:
After setting parameters, all users in the channel can hear the relevant effect.
You can call this method directly or after setAudioEffectPreset. If you call this method after setAudioEffectPreset, ensure that you set the preset parameter of setAudioEffectPreset
to ROOM_ACOUSTICS_3D_VOICE
or PITCH_CORRECTION
and then call this method to set the same enumerator; otherwise, this method overrides setAudioEffectPreset
.
scenario
parameter to AUDIO_SCENARIO_GAME_STREAMING(3)
before calling this method.profile
parameter of setAudioProfile to AUDIO_PROFILE_SPEECH_STANDARD(1)
or AUDIO_PROFILE_IOT(6)
; otherwise, this method call fails.setAudioEffectParameters
:
preset | The options for SDK preset audio effects:
|
param1 |
|
param2 |
|
|
pure virtual |
Sets parameters for SDK preset voice beautifier effects.
Call this method to set a gender characteristic and a reverberation effect for the singing beautifier effect. This method sets parameters for the local user who sends an audio stream.
After you call this method successfully, all users in the channel can hear the relevant effect.
To achieve better audio effect quality, before you call this method, Agora recommends calling setAudioProfile, and setting the scenario
parameter as AUDIO_SCENARIO_GAME_STREAMING(3)
and the profile
parameter as AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)
or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)
.
profile
parameter of setAudioProfile as AUDIO_PROFILE_SPEECH_STANDARD(1)
or AUDIO_PROFILE_IOT(6)
; otherwise, this method call does not take effect.setVoiceBeautifierParameters
:
preset | The options for SDK preset voice beautifier effects:
|
param1 | The gender characteristics options for the singing voice:
|
param2 | The reverberation effects options:
|
|
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 |
Changes the voice pitch of the local speaker.
pitch | The voice pitch. The value ranges between 0.5 and 2.0. The lower the value, the lower the voice pitch. The default value is 1.0 (no change to the local voice pitch). |
|
pure virtual |
Sets the local voice equalization effect.
bandFrequency | The band frequency ranging from 0 to 9, representing the respective 10-band center frequencies of the voice effects, including 31, 62, 125, 500, 1k, 2k, 4k, 8k, and 16k Hz. |
bandGain | Gain of each band in dB. The value ranges from -15 to 15. The default value is 0. |
|
pure virtual |
Sets the local voice reverberation.
reverbKey | The reverberation key: AUDIO_REVERB_TYPE. |
value | The value of the reverberation key: AUDIO_REVERB_TYPE. |
|
pure virtual |
Sets the preset local voice reverberation effect.
reverbPreset | Sets the preset audio reverberation configuration. See AUDIO_REVERB_PRESET. |
|
pure virtual |
Sets the local voice changer option.
voiceChanger | Sets the local voice changer option. See VOICE_CHANGER_PRESET. |
|
pure virtual |
DEPRECATED Specifies an SDK output log file.
The log file records all log data for the SDK’s operation. Ensure that the directory for the log file exists and is writable.
filePath | File path of the log file. The string of the log file is in UTF-8. |
|
pure virtual |
Sets the output log filter level of the SDK.
You can use one or a combination of the filters. The log filter level follows the sequence of OFF
, CRITICAL
, ERROR
, WARNING
, INFO
, and DEBUG
. Choose a filter level and you will see logs preceding that filter level. For example, if you set the log filter level to WARNING
, you see the logs within levels CRITICAL
, ERROR
, and WARNING
.
filter | The log filter level:
|
|
pure virtual |
Sets the output log level of the SDK.
You can set the SDK to ouput the log files of the specified level.
level | The log level:
|
|
pure virtual |
Sets the log file size (KB).
The SDK has two log files, each with a default size of 512 KB. If you set fileSizeInBytes
as 1024 KB, the SDK outputs log files with a total maximum size of 2 MB. If the total size of the log files exceed the set value, the new output log files overwrite the old output log files.
fileSizeInKBytes | The SDK log file size (KB). |
|
pure virtual |
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. |
mirrorMode | Sets the local mirror mode. See VIDEO_MIRROR_MODE_TYPE. |
|
pure virtual |
Updates the display mode of the video view of a remote user.
After initializing the video view of a remote user, you can call this method to update its rendering and mirror modes. This method affects only the video view that the local user sees.
uid | ID of the remote user. |
renderMode | Sets the remote display mode. See #RENDER_MODE_TYPE. |
mirrorMode | Sets the mirror type. See VIDEO_MIRROR_MODE_TYPE. |
|
pure virtual |
Updates the display mode of the local video view.
After initializing the local video view, you can call this method to update its rendering 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.
Use this method before calling the startPreview method, or the mirror mode does not take effect until you call the startPreview
method again.
mirrorMode | Sets the local video mirror mode. See VIDEO_MIRROR_MODE_TYPE. |
|
pure virtual |
Enables or disables the dual video stream mode.
If dual-stream mode is enabled, the subscriber can choose to receive the high-stream (high-resolution high-bitrate video stream) or low-stream (low-resolution low-bitrate video stream) video using setRemoteVideoStreamType.
enabled |
|
|
pure virtual |
Enables or disables the dual video stream mode.
If dual-stream mode is enabled, the subscriber can choose to receive the high-stream (high-resolution high-bitrate video stream) or low-stream (low-resolution low-bitrate video stream) video using setRemoteVideoStreamType.
sourceType |
|
enabled |
|
|
pure virtual |
Enables or disables the dual video stream mode.
If dual-stream mode is enabled, the subscriber can choose to receive the high-stream (high-resolution high-bitrate video stream) or low-stream (low-resolution low-bitrate video stream) video using setRemoteVideoStreamType.
sourceType |
|
enabled |
|
streamConfig |
|
|
pure virtual |
Sets the external audio source.
enabled | Determines whether to enable the external audio source:
|
sampleRate | The Sample rate (Hz) of the external audio source, which can set be as 8000, 16000, 32000, 44100, or 48000. |
channels | The number of channels of the external audio source, which can be set as 1 or 2:
|
sourceNumber | The number of the external audio sources, should be greater than 0. |
|
pure virtual |
Sets the external audio sink.
This method applies to scenarios where you want to use external audio data for playback. After calling the initialize method and pass value of false in the enableAudioDevice
member in the RtcEngineContext struct, you can call the pullAudioFrame method to pull the remote audio data, process it, and play it with the audio effects that you want.
enableAudioDevice
member in the RtcEngineContext struct, the app will not retrieve any audio data from the onPlaybackAudioFrame callback.sampleRate | Sets the sample rate (Hz) of the external audio sink, which can be set as 16000, 32000, 44100 or 48000. |
channels | Sets the number of audio channels of the external audio sink:
|
|
pure virtual |
Pulls the remote audio data.
Before calling this method, call the initialize method and pass value of false in the enableAudioDevice
member in the RtcEngineContext struct, and call the setExternalAudioSink(sampleRate, channels) method to enable and set the external audio sink.
After a successful method call, the app pulls the decoded and mixed audio data for playback.
onPlaybackAudioFrame
: The SDK sends the audio data to the app once every 10 ms. Any delay in processing the audio frames may result in audio jitter.pullAudioFrame
: The app pulls the remote audio data. After setting the audio data parameters, the SDK adjusts the frame buffer and avoids problems caused by jitter in the external audio playback.frame | Pointers to the audio frame. See: AudioFrame. |
|
pure virtual |
Start primary custom audio track local playback.
|
pure virtual |
Stop primary custom audio track local playback.
|
pure virtual |
Start secondary custom audio track local playback.
|
pure virtual |
Stop secondary custom audio track local playback.
|
pure virtual |
Sets the audio recording format for the onRecordAudioFrame callback.
sampleRate | The sample rate (Hz) of the audio data returned in the onRecordAudioFrame callback, which can set be as 8000, 16000, 32000, 44100, or 48000. |
channel | The number of audio channels of the audio data returned in the onRecordAudioFrame callback, which can be set as 1 or 2:
|
mode | This mode is deprecated. |
samplesPerCall | not support. Sampling points in the called data returned in onRecordAudioFrame(). For example, it is usually set as 1024 for stream pushing. |
|
pure virtual |
Sets the audio playback format for the onPlaybackAudioFrame callback.
sampleRate | Sets the sample rate (Hz) of the audio data returned in the onPlaybackAudioFrame callback, which can set be as 8000, 16000, 32000, 44100, or 48000. |
channel | The number of channels of the audio data returned in the onPlaybackAudioFrame callback, which can be set as 1 or 2:
|
mode | Deprecated. The use mode of the onPlaybackAudioFrame() callback: agora::rtc::RAW_AUDIO_FRAME_OP_MODE_TYPE. |
samplesPerCall | not support. Sampling points in the called data returned in onPlaybackAudioFrame(). For example, it is usually set as 1024 for stream pushing. |
|
pure virtual |
Sets the mixed audio format for the onMixedAudioFrame callback.
sampleRate | The sample rate (Hz) of the audio data returned in the onMixedAudioFrame callback, which can set be as 8000, 16000, 32000, 44100, or 48000. |
channel | The number of channels of the audio data in onMixedAudioFrame callback, which can be set as 1 or 2:
|
samplesPerCall | not support. Sampling points in the called data returned in onMixedAudioFrame . For example, it is usually set as 1024 for stream pushing. |
|
pure virtual |
Sets the audio playback format before mixing in the onPlaybackAudioFrameBeforeMixing callback.
sampleRate | The sample rate (Hz) of the audio data returned in onPlaybackAudioFrameBeforeMixing , which can set be as 8000, 16000, 32000, 44100, or 48000. |
channel | Number of channels of the audio data returned in onPlaybackAudioFrameBeforeMixing , which can be set as 1 or 2:
|
|
pure virtual |
Enable the audio spectrum monitor.
intervalInMS | Sets the time interval(ms) between two consecutive audio spectrum callback. The default value is 100. This param should be larger than 10. |
|
pure virtual |
Disalbe the audio spectrum monitor.
|
pure virtual |
Registers an audio spectrum observer.
You need to implement the IAudioSpectrumObserver
class in this method, and register the following callbacks according to your scenario:
observer | A pointer to the audio spectrum observer: IAudioSpectrumObserver. |
|
pure virtual |
Releases the audio spectrum observer.
observer | The pointer to the audio spectrum observer: IAudioSpectrumObserver. |
|
pure virtual |
Adjusts the recording volume.
volume | The recording volume, which ranges from 0 to 400: |
|
pure virtual |
Mute or resume recording signal volume.
mute | Determines whether to mute or resume the recording signal volume.
|
|
pure virtual |
Adjusts the playback volume.
volume | The playback volume, which ranges from 0 to 400: |
|
pure virtual |
|
pure virtual |
Enables loopback recording.
If you enable loopback recording, the output of the default sound card is mixed into the audio stream sent to the other end.
enabled | Sets whether to enable/disable loopback recording.
|
|
pure virtual |
Adjusts the loopback recording volume.
volume | The loopback volume, which ranges from 0 to 100: |
|
pure virtual |
Retrieves the audio volume for recording loopback.
|
pure virtual |
Enables in-ear monitoring (for Android and iOS only).
enabled | Determines whether to enable in-ear monitoring.
|
includeAudioFilters | The type of the ear monitoring: EAR_MONITORING_FILTER_TYPE |
|
pure virtual |
Sets the volume of the in-ear monitor (for Android and iOS only).
volume | Sets the volume of the in-ear monitor. The value ranges between 0 and 100 (default). |
|
pure virtual |
|
pure virtual |
Enable/Disable extension.
provider_name | name for provider, e.g. agora.io. |
extension_name | name for extension, e.g. agora.beauty. |
enable | enable or disable.
|
|
pure virtual |
Set extension specific property.
provider_name | name for provider, e.g. agora.io. |
extension_name | name for extension, e.g. agora.beauty. |
key | key for the property. |
json_value | property value. |
|
pure virtual |
Get extension specific property.
provider_name | name for provider, e.g. agora.io. |
extension_name | name for extension, e.g. agora.beauty. |
key | key for the property. |
json_value | property value. |
buf_len | max length of the json value buffer |
|
pure virtual |
Sets the camera capture configuration.
config | Sets the camera capturer configuration. See CameraCapturerConfiguration. |
|
pure virtual |
Switches between front and rear cameras.
|
pure virtual |
Checks whether the camera zoom function is supported.
|
pure virtual |
Checks whether the camera face detect is supported.
|
pure virtual |
Checks whether the camera flash function is supported.
|
pure virtual |
Checks whether the camera manual focus function is supported.
|
pure virtual |
Checks whether the camera auto focus function is supported.
|
pure virtual |
Sets the camera zoom ratio.
factor | The camera zoom factor. It ranges from 1.0 to the maximum zoom supported by the camera. |
|
pure virtual |
Sets the camera face detection.
enabled | The camera face detection enabled. |
|
pure virtual |
Gets the maximum zoom ratio supported by the camera.
|
pure virtual |
Sets the manual focus position.
positionX | The horizontal coordinate of the touch point in the view. |
positionY | The vertical coordinate of the touch point in the view. |
|
pure virtual |
Enables the camera flash.
isOn | Determines whether to enable the camera flash.
|
|
pure virtual |
Enables the camera auto focus face function.
enabled | Determines whether to enable the camera auto focus face mode.
|
|
pure virtual |
Checks whether the camera exposure function is supported.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
|
pure virtual |
Sets the camera exposure position.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
A successful setCameraExposurePosition method call triggers the onCameraExposureAreaChanged callback on the local client.
positionXinView | The horizontal coordinate of the touch point in the view. |
positionYinView | The vertical coordinate of the touch point in the view. |
|
pure virtual |
Checks whether the camera auto exposure function is supported.
|
pure virtual |
Enables the camera auto exposure face function.
enabled | Determines whether to enable the camera auto exposure face mode.
|
|
pure virtual |
Sets the default audio route (for Android and iOS only).
Most mobile phones have two audio routes: an earpiece at the top, and a speakerphone at the bottom. The earpiece plays at a lower volume, and the speakerphone at a higher volume.
When setting the default audio route, you determine whether audio playback comes through the earpiece or speakerphone when no external audio device is connected.
Depending on the scenario, Agora uses different default audio routes:
Call this method before, during, or after a call, to change the default audio route. When the audio route changes, the SDK triggers the onAudioRoutingChanged callback.
defaultToSpeaker | Whether to set the speakerphone as the default audio route:
|
|
pure virtual |
Enables/Disables the speakerphone temporarily (for Android and iOS only).
When the audio route changes, the SDK triggers the onAudioRoutingChanged callback.
You can call this method before, during, or after a call. However, Agora recommends calling this method only when you are in a channel to change the audio route temporarily.
speakerOn | Whether to set the speakerphone as the temporary audio route:
|
|
pure virtual |
Checks whether the speakerphone is enabled (for Android and iOS only).
|
pure virtual |
Shares the whole or part of a screen by specifying the display ID.
displayId | The display ID of the screen to be shared. This parameter specifies which screen you want to share. For information on how to get the displayId, see the advanced guide: Share the Screen. |
regionRect | (Optional) Sets the relative location of the region to the screen. NIL means sharing the whole screen. See Rectangle. If the specified region overruns the screen, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen. |
captureParams | Sets the screen sharing encoding parameters. See ScreenCaptureParameters. |
|
pure virtual |
Shares the whole or part of a screen by specifying the screen rect.
screenRect | Sets the relative location of the screen to the virtual screen. For information on how to get screenRect, see the advanced guide: Share the Screen. |
regionRect | (Optional) Sets the relative location of the region to the screen. NULL means sharing the whole screen. See Rectangle. If the specified region overruns the screen, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen. |
captureParams | Sets the screen sharing encoding parameters. See ScreenCaptureParameters. |
|
pure virtual |
Screen capturer by specifying a result data which obtained from a succesful screen capture request.
This method shares the whole screen.
mediaProjectionPermissionResultData | The resulting data from android.app.Activity#onActivityResult . |
captureParams | Sets the screen sharing encoding parameters. See ScreenCaptureParameters. |
|
pure virtual |
Shares the whole or part of a window by specifying the window ID.
windowId | The ID of the window to be shared. For information on how to get the windowId, see the advanced guide Share Screen. |
regionRect | (Optional) The relative location of the region to the window. NULL means sharing the whole window. See Rectangle. If the specified region overruns the window, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole window. |
captureParams | The window sharing encoding parameters. See ScreenCaptureParameters. |
|
pure virtual |
Sets the content hint for screen sharing.
A content hint suggests the type of the content being shared, so that the SDK applies different optimization algorithm to different types of content.
contentHint | Sets the content hint for screen sharing: VIDEO_CONTENT_HINT. |
|
pure virtual |
Updates the screen sharing region.
regionRect | Sets the relative location of the region to the screen or window. NULL means sharing the whole screen or window. See Rectangle. If the specified region overruns the screen or window, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen or window. |
|
pure virtual |
Updates the screen sharing parameters.
captureParams | Sets the screen sharing encoding parameters: ScreenCaptureParameters. |
|
pure virtual |
Stops the screen sharing.
|
pure virtual |
Gets the current call ID.
When a user joins a channel on a client, a callId
is generated to identify the call.
After a call ends, you can call rate
or complain
to gather feedback from the customer. These methods require a callId
parameter. To use these feedback methods, call the this method first to retrieve the callId
during the call, and then pass the value as an argument in the rate
or complain
method after the call ends.
callId | The reference to the call ID. |
|
pure virtual |
Allows a user to rate the call.
It is usually called after the call ends.
callId | The call ID retrieved from the getCallId method. |
rating | The rating of the call between 1 (the lowest score) to 5 (the highest score). |
description | (Optional) The description of the rating. The string length must be less than 800 bytes. |
|
pure virtual |
Allows a user to complain about the call quality.
This method is usually called after the call ends.
callId | The call ID retrieved from the getCallId method. |
description | (Optional) The description of the complaint. The string length must be less than 800 bytes. |
|
pure virtual |
Publishes the local stream to the CDN.
This method call triggers the onRtmpStreamingStateChanged callback on the local client to report the state of adding a local stream to the CDN.
joinChannel
.url | The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. The URL address must not contain special characters, such as Chinese language characters. |
transcodingEnabled | Determines whether to enable transcoding. If you set this parameter as true , ensure that you call setLiveTranscoding before this method.
|
|
pure virtual |
Removes an RTMP stream from the CDN.
This method removes the RTMP URL address added by addPublishStreamUrl
from a CDN live stream. The SDK reports the result of this method call in the onRtmpStreamingStateChanged callback.
joinChannel
.url | The RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes. The URL address must not contain special characters, such as Chinese language characters. |
|
pure virtual |
Sets the video layout and audio settings for CDN live.
The SDK triggers the onTranscodingUpdated callback when you call this method to update the LiveTranscoding
class. If you call this method to set the LiveTranscoding
class for the first time, the SDK does not trigger the onTranscodingUpdated
callback.
setClientRole
method and set the user role as the host.setLiveTranscoding
method before addPublishStreamUrl method.transcoding | Sets the CDN live audio and video transcoding settings: LiveTranscoding. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Gets the current connection state of the SDK.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Registers a packet observer.
The Agora Native SDK allows your app to register a packet observer to receive events whenever a voice or video packet is transmitting.
observer | The IPacketObserver object. |
|
pure virtual |
Sets the built-in encryption mode.
The Agora Native SDK supports built-in encryption. Call this API to set the encryption mode.
All users in the same channel must use the same encryption mode and password. Refer to information related to the encryption algorithm on the differences between encryption modes.
encryptionMode | Encryption mode:
|
|
pure virtual |
Enables built-in encryption.
Use this method to specify an encryption password to enable built-in encryption before joining a channel. All users in a channel must set the same encryption password. The encryption password is automatically cleared once a user has left the channel. If the encryption password is not specified or set to empty, the encryption function will be disabled.
secret | The encryption password. |
|
pure virtual |
Enables/Disables the built-in encryption.
In scenarios requiring high security, Agora recommends calling this method to enable the built-in encryption before joining a channel.
All users in the same channel must use the same encryption mode and encryption key. Once all users leave the channel, the encryption key of this channel is automatically cleared.
enabled | Whether to enable the built-in encryption:
|
config | Configurations of built-in encryption schemas. 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 tranmission.
reliable
and ordered
.[out] | streamId | The ID of the stream data. |
reliable | Sets whether the recipients are guaranteed to receive the data stream from the sender within five seconds:
| |
ordered | Sets whether the recipients receive the data stream in the sent order:
|
|
pure virtual |
Creates a data stream.
Each user can create up to five data streams during the lifecycle of the IChannel.
streamId | The ID of the created data stream. |
config | The config of data stream. |
channelId | The channel name. |
uid | ID of the local user. |
|
pure virtual |
Sends a data stream.
After calling createDataStream, you can call this method to send a data stream to all users in the channel.
The SDK has the following restrictions on this method:
After the remote user receives the data stream within 5 seconds, the SDK triggers the onStreamMessage callback on the remote client. After the remote user does not receive the data stream within 5 seconds, the SDK triggers the onStreamMessageError callback on the remote client.
COMMUNICATION
profile or to the hosts in the LIVE_BROADCASTING
profile. If an audience in the LIVE_BROADCASTING
profile calls this method, the audience may be switched to a host.streamId | The ID of the stream data. |
data | The data stream. |
length | The length (byte) of the data stream. |
channelId | The channel name. |
uid | ID of the local user. |
|
pure virtual |
DEPRECATED Adds a watermark image to the local video or CDN live stream.
This method is not recommend, Use addVideoWatermark2 instead.
This method adds a PNG watermark image to the local video stream for the recording device, channel audience, and CDN live audience to view and capture.
To add the PNG file to the CDN live publishing stream, see the setLiveTranscoding method.
watermark | Pointer to the watermark image to be added to the local video stream. See RtcImage. |
|
pure virtual |
Adds a watermark image to the local video.
This method adds a PNG watermark image to the local video in a live broadcast. Once the watermark image is added, all the audience in the channel (CDN audience included), and the recording device can see and capture it. Agora supports adding only one watermark image onto the local video, and the newly watermark image replaces the previous one.
The watermark position depends on the settings in the setVideoEncoderConfiguration method:
setVideoEncoderConfiguration
method. Otherwise, the watermark image will be cropped.visibleInPreview
member in the WatermarkOptions class to set whether or not the watermark is visible in preview.watermarkUrl | The local file path of the watermark image to be added. This method supports adding a watermark image from the local absolute or relative file path. |
options | Pointer to the watermark's options to be added. See WatermarkOptions for more infomation. |
channelId | The channel name. |
uid | ID of the local user. |
|
pure virtual |
Removes the watermark image on the video stream added by addVideoWatermark().
channelId | The channel name. |
uid | ID of the local user. |
|
pure virtual |
Removes the watermark image on the video stream added by addVideoWatermark().
|
pure virtual |
Injects an online media stream to a live broadcast.
If the media stream is successfully injected, you can find the stream in the channel and the uid of the stream is 666.
The addInjectStreamUrl() method call triggers the following callbacks:
url | The URL address to be added to the ongoing live broadcast. You can use the RTMP, HLS, and FLV protocols. |
config | The definition of the added voice or video stream: InjectStreamConfig. |
|
pure virtual |
Removes the injected online media stream from a live broadcast.
If this method call is successful, the SDK triggers the onUserOffline() callback and returns a stream uid of 666.
url | The HTTP/HTTPS URL address of the added stream to be removed. |
|
pure virtual |
Disables the audio function in the channel.
|
pure virtual |
Resumes the audio function in the channel.
|
pure virtual |
Enables interoperability with the Agora Web SDK (Live Broadcast only).
Use this method when the channel profile is Live Broadcast. Interoperability with the Agora Web SDK is enabled by default when the channel profile is Communication.
enabled | Determines whether to enable interoperability with the Agora Web SDK.
|
|
pure virtual |
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.
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
method.LIVE_BROADCASTING
channel profile.observer | IMetadataObserver. |
type | The metadata type. See METADATA_TYPE. The SDK supports VIDEO_METADATA (0) only for now. |
|
pure virtual |
Unregisters the metadata observer.
observer | IMetadataObserver. |
type | The metadata type. See METADATA_TYPE. The SDK supports VIDEO_METADATA (0) only for now. |
|
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 |
|
pure virtual |
Registers a user account.
Once registered, the user account can be used to identify the local user when the user joins the channel. After the user successfully registers a user account, the SDK triggers the onLocalUserRegistered callback on the local client, reporting the user ID and user account of the local user.
To join a channel with a user account, you can choose either of the following:
The difference between the two is that for the former, the time elapsed between calling the joinChannelWithUserAccount method and joining the channel is shorter than the latter.
userAccount
parameter. Otherwise, this method does not take effect.userAccount
parameter is unique in the channel.appId | The App ID of your project. |
userAccount | The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
|
|
pure virtual |
Joins the channel with a user account.
After the user successfully joins the channel, the SDK triggers the following callbacks:
COMMUNICATION
profile, or is a host in the LIVE_BROADCASTING
profile.token | The token generated at your server:
|
channelId | The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
|
userAccount | The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
|
|
pure virtual |
Joins the channel with a user account.
After the user successfully joins the channel, the SDK triggers the following callbacks:
COMMUNICATION
profile, or is a host in the LIVE_BROADCASTING
profile.token | The token generated at your server:
|
channelId | The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
|
userAccount | The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
|
options | The channel media options: ChannelMediaOptions |
|
pure virtual |
Joins the channel with a user account.
After the user successfully joins the channel, the SDK triggers the following callbacks:
COMMUNICATION
profile, or is a host in the LIVE_BROADCASTING
profile.token | The token generated at your server:
|
channelId | The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
|
userAccount | The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
|
options | The channel media options: ChannelMediaOptions |
eventHandler | The pointer to the IRtcEngine event handler: IRtcEngineEventHandler. |
|
pure virtual |
Gets the user information by passing in the user account.
After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object (userInfo
), and triggers the onUserInfoUpdated callback on the local client.
After receiving the oonUserInfoUpdated callback, you can call this method to get the user ID of the remote user from the userInfo
object by passing in the user account.
userAccount | The user account of the user. Ensure that you set this parameter. | |
[in,out] | userInfo | A userInfo object that identifies the user:
|
channelId | The channel name. | |
localUserAccount | The user account of the local user. |
|
pure virtual |
Gets the user information by passing in the user ID.
After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object (userInfo
), and triggers the onUserInfoUpdated callback on the local client.
After receiving the onUserInfoUpdated callback, you can call this method to get the user account of the remote user from the userInfo
object by passing in the user ID.
uid | The user ID of the remote user. Ensure that you set this parameter. | |
[in,out] | userInfo | A userInfo object that identifies the user:
|
channelId | The channel name. | |
localUserAccount | The user account of the local user. |
|
pure virtual |
Starts to relay media streams across channels.
After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged and onChannelMediaRelayEvent callbacks, and these callbacks return the state and events of the media stream relay.
LIVE_BROADCASTING
channel.configuration | The configuration of the media stream relay: ChannelMediaRelayConfiguration. |
|
pure virtual |
Updates the channels for media stream relay. After a successful startChannelMediaRelay method call, if you want to relay the media stream to more channels, or leave the current relay channel, you can call the updateChannelMediaRelay method.
After a successful method call, the SDK triggers the onChannelMediaRelayEvent callback with the RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL (7) state code.
configuration | The media stream relay configuration: ChannelMediaRelayConfiguration. |
|
pure virtual |
Stops the media stream relay.
Once the relay stops, the host quits all the destination channels.
After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged callback. If the callback returns RELAY_STATE_IDLE (0) and RELAY_OK (0), the host successfully stops the relay.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |