Class RtcEngine
- Direct Known Subclasses:
RtcEngineEx
RtcEngine API methods in the same thread instead
of in multiple threads. In previous versions, this class was named
AgoraAudio, and was renamed to RtcEngine from version 1.0.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHandler(IRtcEngineEventHandler handler) Adds the IRtcEngineEventHandler.abstract intaddVideoWatermark(AgoraImage watermark) Deprecated.From v2.9.1.abstract intaddVideoWatermark(WatermarkConfig config) abstract intaddVideoWatermark(String watermarkUrl, WatermarkOptions options) Deprecated.From v4.6.0.abstract intadjustAudioMixingPlayoutVolume(int volume) Adjusts the audio mixing volume for local playback.abstract intadjustAudioMixingPublishVolume(int volume) Adjusts the audio mixing volume for publishing (for remote users).abstract intadjustAudioMixingVolume(int volume) Adjusts the volume of audio mixing.abstract intadjustCustomAudioPlayoutVolume(int trackId, int volume) Adjust the custom audio playout volume by source id.abstract intadjustCustomAudioPublishVolume(int trackId, int volume) Adjust the custom audio publish volume by source id.abstract intadjustPlaybackSignalVolume(int volume) Adjusts the playback volume.abstract intadjustRecordingSignalVolume(int volume) Adjusts the recording volume.abstract intadjustUserPlaybackSignalVolume(int uid, int volume) Adjust the playback volume of the user specified by uid.abstract intRemoves the watermark image from the video stream added byaddVideoWatermark.abstract intAllows a user to complain about the call quality.abstract intConfigures the rhythm player.static RtcEnginecreate(Context context, String appId, IRtcEngineEventHandler handler) Creates anRtcEngineinstance.static RtcEnginecreate(RtcEngineConfig config) Creates an RtcEngine instance.abstract intcreateCustomAudioTrack(Constants.AudioTrackType trackType, AudioTrackConfig config) Create a custom audio track and get the audio track id.abstract intGet an custom encoded video track id created by internal,which could used to publish or previewabstract intGet an custom video track id created by internal,which could used to publish or previewabstract intcreateDataStream(boolean reliable, boolean ordered) Creates a data stream.abstract intcreateDataStream(DataStreamConfig config) Creates a data stream.abstract IMediaPlayerCreate a media player You can use this function to create a ffmpeg or simple media playerabstract AgoraMediaRecorderCreate a media recorder You can use this function to create a media recorderabstract IVideoEffectObjectcreateVideoEffectObject(String bundlePath, Constants.MediaSourceType sourceType) static voiddestroy()static voiddestroy(IRtcEngineReleaseCallback callback) abstract intdestroyCustomAudioTrack(int trackId) Destroy custom audio track by trackIdabstract intdestroyCustomEncodedVideoTrack(int video_track_id) destroy a created custom encoded video track idabstract intdestroyCustomVideoTrack(int video_track_id) destroy a created custom video track idabstract voiddestroyMediaRecorder(AgoraMediaRecorder mediaRecorder) Destroy a media player source instance.abstract intdestroyVideoEffectObject(IVideoEffectObject videoEffectObject) abstract intDisables the audio.abstract intDisalbe the audio spectrum monitor.abstract intDisables the video.abstract intEnables the audio.abstract intenableAudioSpectrumMonitor(int intervalInMS) Enable the audio spectrum monitor.abstract intenableAudioVolumeIndication(int interval, int smooth, boolean reportVad) Enables the `onAudioVolumeIndication` callback to report on which users are speaking and the speakers' volume.abstract intenableContentInspect(boolean enabled, ContentInspectConfig config) abstract intenableCustomAudioLocalPlayback(int trackId, boolean enabled) Sets the external audio track.abstract intenableDualStreamMode(boolean enabled) Deprecated.v4.2.0.abstract intenableDualStreamMode(boolean enabled, SimulcastStreamConfig streamConfig) Deprecated.v4.2.0.abstract intenableEncryption(boolean enabled, io.agora.rtc2.internal.EncryptionConfig config) Enables/Disables the built-in encryption.abstract intenableExtension(String provider, String extension, boolean enable) Enable/Disable an extension.abstract intenableExtension(String provider, String extension, boolean enable, Constants.MediaSourceType sourceType) Enable/Disable an extension.abstract intenableExtension(String provider, String extension, ExtensionInfo extensionInfo, boolean enable) Enable/Disable an extension.abstract intenableExternalAudioSourceLocalPlayback(boolean enabled) Enable or disable the external audio source local playback.abstract intenableFaceDetection(boolean enabled) Enables the camera face detect.abstract booleanenableHighPerfWifiMode(boolean enable) Deprecated.This method is deprecated.abstract intenableInEarMonitoring(boolean enabled) Enables in-ear monitoring.abstract intenableInEarMonitoring(boolean enabled, int includeAudioFilters) Enables in-ear monitoring.abstract intabstract intenableLocalAudio(boolean enabled) Enables or disables the local audio capture.abstract intenableLocalVideo(boolean enabled) Disables or re-enables the local video capture.abstract intenableSoundPositionIndication(boolean enabled) Enables/Disables stereo panning for remote users.abstract intenableSpatialAudio(boolean enabled) abstract intEnables the video.abstract intenableVideoImageSource(boolean enabled, ImageTrackOptions options) Enable or disable video image source to replace the current video source published or resume itabstract intenableVirtualBackground(boolean enabled, VirtualBackgroundSource backgroundSource, SegmentationProperty segproperty) Enables/Disables portrait segmentation and repalce the background(not portrait area) with specified source.abstract intenableVirtualBackground(boolean enabled, VirtualBackgroundSource backgroundSource, SegmentationProperty segproperty, Constants.MediaSourceType sourceType) Enables/Disables portrait segmentation and repalce the background(not portrait area) with specified source.abstract intenableVoiceAITuner(boolean enabled, Constants.VOICE_AI_TUNER_TYPE type) Enables or disables the voice AI tuner.abstract intenableWebSdkInteroperability(boolean enabled) Enables interoperability with the Agora Web SDK (Live Broadcast only).abstract DeviceInfoGets the the Audio device Infoabstract IAudioEffectManagerGets the IAudioEffectManager object associated with the current RTC engine.abstract intGets the playback position (ms) of the music file.abstract intGets the duration (ms) of the music file.abstract intRetrieves the audio mixing volume for local playback.abstract intRetrieves the audio mixing volume for publishing.abstract intGet the audio track count of mixing music file.abstract StringGets the current call ID.abstract floatGets the maximum zoom ratio supported by the camera.abstract intGets the connection state of the SDK.abstract longabstract intgetEffectCurrentPosition(int soundId) Gets the playback position of the audio effect file.abstract intgetEffectDuration(String filePath) Gets the duration of the audio effect file.abstract doubleGets the volume of the audio effects.static StringgetErrorDescription(int error) Gets the warning or error description.abstract StringgetExtensionProperty(String provider, String extension, ExtensionInfo extensionInfo, String key) Gets the properties of an extension.abstract StringgetExtensionProperty(String provider, String extension, String key) Gets the properties of an extension.abstract StringgetExtensionProperty(String provider, String extension, String key, Constants.MediaSourceType sourceType) Gets the properties of an extension.abstract FaceShapeAreaOptionsgetFaceShapeAreaOptions(int shapeArea) Gets the face shape area options.abstract FaceShapeAreaOptionsgetFaceShapeAreaOptions(int shapeArea, Constants.MediaSourceType sourceType) Gets the face shape area options.abstract FaceShapeBeautyOptionsGets the face shape beauty options.abstract FaceShapeBeautyOptionsgetFaceShapeBeautyOptions(Constants.MediaSourceType sourceType) Gets the face shape beauty options.abstract IH265Transcoderget an H265Transcoder instance, which is used tostatic StringDeprecated.abstract IMediaPlayerCacheManagerget an MediaPlayerCacheManager instance, which is used to set and manage the player cache, implemented in the form of a singleton, independent of the player.abstract longReturns the native handler of the SDK Engine.abstract longgetNativeMediaPlayer(int sourceId) Returns the native handler of the mediaplayer.abstract intGet network typeabstract longReturn current NTP(unix timestamp) time in milliseconds.abstract StringgetParameter(String parameter, String args) Gets the Agora SDK’s parameters for customization purposes.abstract StringgetParameters(String parameters) Queries internal statesstatic intDeprecated.This method is deprecated.static StringGets the SDK version.abstract intgetUserInfoByUid(int uid, UserInfo userInfo) Gets the user information by passing in the user ID.abstract intgetUserInfoByUserAccount(String userAccount, UserInfo userInfo) Gets the user information by passing in the user account.abstract intgetVolumeOfEffect(int soundId) Get the volume of a specified sound effect.abstract booleanChecks whether the camera auto focus function is supported.abstract booleanChecks whether the camera exposure function is supported.abstract booleanChecks whether camera supports to set exposure value.abstract booleanChecks whether the camera face detect function is supported.abstract booleanChecks whether the camera manual focus function is supported.abstract booleanChecks whether the camera flash function is supported.abstract booleanChecks whether the camera zoom function is supported.abstract booleanisFeatureAvailableOnDevice(int type) abstract booleanChecks whether the speakerphone is enabled.abstract booleanChecks whether texture encoding is supported.abstract intjoinChannel(String token, String channelId, int uid, ChannelMediaOptions options) Joins a channel with media options.abstract intjoinChannel(String token, String channelId, String optionalInfo, int uid) Joins a channel.abstract intjoinChannelWithUserAccount(String token, String channelName, String userAccount) Joins the channel with a user account.abstract intjoinChannelWithUserAccount(String token, String channelName, String userAccount, ChannelMediaOptions options) Joins the channel with a user account, and configures whether to automatically subscribe to audio or video streams after joining the channel.abstract intLeaves the channel.abstract intleaveChannel(LeaveChannelOptions options) Leaves the channel.abstract intloadExtensionProvider(String path) abstract voidmonitorBluetoothHeadsetEvent(boolean monitor) Deprecated.abstract voidmonitorHeadsetEvent(boolean monitor) Deprecated.abstract intmuteAllRemoteAudioStreams(boolean muted) Stops or resumes receiving all remote audio streams.abstract intmuteAllRemoteVideoStreams(boolean muted) Stops or resumes receiving all remote video streams.abstract intmuteLocalAudioStream(boolean muted) Stops or resumes sending the local audio stream.abstract intmuteLocalVideoStream(boolean muted) Stops or resumes sending the local video stream.abstract intmuteRecordingSignal(boolean muted) Mute or resume recording signal volume.abstract intmuteRemoteAudioStream(int uid, boolean muted) Stops or resumes receiving the audio stream of a specified user.abstract intmuteRemoteVideoStream(int uid, boolean muted) Stops or resumes receiving the video stream of a specified user.abstract intpause the channels for media stream relay.abstract intPauses playing all audio effects.abstract intDisables the audio function in the channel.abstract intPauses playing and mixing the music file.abstract intpauseEffect(int soundId) Pauses playing the specified audio effect.abstract intplayAllEffects(int loopCount, double pitch, double pan, double gain, boolean publish) Plays all audio effects.abstract intplayEffect(int soundId, String filePath, int loopCount, double pitch, double pan, double gain, boolean publish) Plays a specified audio effect.abstract intplayEffect(int soundId, String filePath, int loopCount, double pitch, double pan, double gain, boolean publish, int startPos) Plays a specified audio effect.abstract intpreloadChannel(String token, String channelName, int optionalUid) Preload a channel.abstract intpreloadChannelWithUserAccount(String token, String channelName, String userAccount) Preload a channel.abstract intpreloadEffect(int soundId, String filePath) Preloads a specified audio effect.abstract intpreloadEffect(int soundId, String filePath, int startPos) Preloads a specified audio effect.abstract intpullPlaybackAudioFrame(byte[] data, int lengthInByte) Pulls the remote audio frame.abstract intpullPlaybackAudioFrame(ByteBuffer data, int lengthInByte) Pulls the remote audio frame.abstract intpushExternalAudioFrame(byte[] data, long timestamp) Deprecated.This method is deprecated.abstract intpushExternalAudioFrame(byte[] data, long timestamp, int sampleRate, int channels, Constants.BytesPerSample bytesPerSample, int trackId) Pushes the external audio data to the app.abstract intpushExternalAudioFrame(ByteBuffer data, long timestamp, int trackId) Deprecated.This method is deprecated.abstract intpushExternalAudioFrame(ByteBuffer data, long timestamp, int sampleRate, int channels, Constants.BytesPerSample bytesPerSample, int trackId) Pushes the external audio data to the app.abstract intpushExternalEncodedVideoFrame(ByteBuffer data, EncodedVideoFrameInfo frameInfo) Deprecated.This method is deprecated.abstract intpushExternalEncodedVideoFrameById(ByteBuffer data, EncodedVideoFrameInfo frameInfo, int videoTrackId) Pushes the encoded external video frame to the app with specified connection.abstract booleanpushExternalVideoFrame(VideoFrame frame) Deprecated.This method is deprecated.abstract intpushExternalVideoFrameById(VideoFrame frame, int videoTrackId) Pushes the external video frame to the app.abstract AgoraFocalLengthInfo[]Query all focal attributes supported by the camera.abstract CodecCapInfo[]queryCodecCapability.abstract intQueries the score of the current device.abstract intqueryHDRCapability(Constants.VIDEO_MODULE_TYPE moduleType) Queries the HDR capability of the video module.abstract intQueries the ability of screen sharing to support the minimum frame rate.abstract intAllows a user to rate the call.abstract intregisterAudioEncodedFrameObserver(io.agora.rtc2.internal.AudioEncodedFrameObserverConfig config, IAudioEncodedFrameObserver observer) Registers an encoded audio frame observer object.abstract intRegisters an audio frame observer object.abstract intRegisters an audio spectrum observer.abstract intregisterExtension(String provider, String extension, Constants.MediaSourceType sourceType) Registers an extension.abstract intregisterFaceInfoObserver(IFaceInfoObserver receiver) Registers an face info observer object.abstract intregisterLocalUserAccount(String appId, String userAccount) Registers a user account.abstract intregisterMediaMetadataObserver(IMetadataObserver observer, int type) Registers the metadata observer.abstract intRegisters a receiver object for the encoded video image.abstract intRegisters a video frame observer object.voidremoveHandler(IRtcEngineEventHandler handler) Removes the specified IRtcEngineEventHandler object.abstract intabstract intrenewToken(String token) Renews the token.abstract intresume the channels for media stream relay.abstract intResumes playing all audio effects.abstract intEnables the audio function in the channel.abstract intResumes playing and mixing the music file.abstract intresumeEffect(int soundId) Resumes playing the specified audio effect.abstract intselectAudioTrack(int audioIndex) select the track of the mixing music file.abstract intsendAudioMetadata(byte[] metadata) abstract intsendCustomReportMessage(String id, String category, String event, String label, int value) Agora supports reporting and analyzing customized messages.abstract intsendMediaControlMessage(int uid, byte[] message) abstract intsendRdtMessage(int uid, int type, byte[] message) abstract intsendStreamMessage(int streamId, byte[] message) Sends a data stream.abstract intset advanced audio optionabstract intsetAINSMode(boolean enabled, int mode) Enables/Disables Agora AI Noise Suppression(AINS) with preset mode.abstract intsetAudioEffectParameters(int preset, int param1, int param2) Sets parameters for SDK preset audio effects.abstract intsetAudioEffectPreset(int preset) Sets an SDK preset audio effect.abstract intIn dual-channel music files, different audio data can be stored on the left and right channels.abstract intsetAudioMixingPitch(int pitch) Sets the pitch of the music file.abstract intsetAudioMixingPlaybackSpeed(int speed) Sets the playback speed of the current music file.abstract intsetAudioMixingPosition(int pos) Sets the playback position (ms) of the music file to a different starting position (the default plays from the beginning).abstract intsetAudioProfile(int profile) Sets the audio profile.abstract intsetAudioProfile(int profile, int scenario) Sets the audio parameters and application scenarios.abstract intsetAudioScenario(int scenario) abstract intsetAVSyncSource(String channelId, int uid) Bind local user and a remote user as an audio&video sync group.abstract intsetBeautyEffectOptions(boolean enabled, BeautyOptions options) Enables/Disables image enhancement and sets the options.abstract intsetBeautyEffectOptions(boolean enabled, BeautyOptions options, Constants.MediaSourceType sourceType) Enables/Disables image enhancement and sets the options.abstract intsetCameraAutoFocusFaceModeEnabled(boolean enabled) Enables the camera auto focus face function.abstract intSets the camera capturer configuration.abstract intsetCameraExposureFactor(int factor) Sets the camera exposure ratio.abstract intsetCameraExposurePosition(float positionXinView, float positionYinView) Sets the camera exposure position.abstract intsetCameraFocusPositionInPreview(float positionX, float positionY) Sets the manual focus position.abstract intsetCameraTorchOn(boolean isOn) Enables the camera flash.abstract intsetCameraZoomFactor(float factor) Sets the camera zoom ratio.abstract intsetChannelProfile(int profile) Sets the channel profile.abstract intsetClientRole(int role) Sets the role of a user.abstract intsetClientRole(int role, ClientRoleOptions options) Sets the role of a user (`LIVE_BROADCASTING` profile only).abstract intsetCloudProxy(int proxyType) Sets the Agora cloud proxy service.abstract intsetColorEnhanceOptions(boolean enabled, ColorEnhanceOptions options) Sets color enhancement.abstract intsetColorEnhanceOptions(boolean enabled, ColorEnhanceOptions options, Constants.MediaSourceType sourceType) Sets color enhancement.abstract intsetDefaultAudioRoutetoSpeakerphone(boolean defaultToSpeaker) Sets the default audio route.abstract intsetDirectCdnStreamingAudioConfiguration(int profile) Deprecated.v4.6.0.abstract intDeprecated.v4.6.0.abstract intEnables, disables or auto enable the dual video stream mode.abstract intsetDualStreamMode(Constants.SimulcastStreamMode mode, SimulcastStreamConfig streamConfig) Enables, disables or auto enable the dual video stream mode.abstract intsetEarMonitoringAudioFrameParameters(int sampleRate, int channel, int mode, int samplesPerCall) Sets the audio ear monitoring format for theonEarMonitoringAudioFramecallback.abstract intsetEffectPosition(int soundId, int pos) Sets the playback position of an audio effect file.abstract intsetEffectsVolume(double volume) Sets the volume of audio effects.abstract intsetEnableSpeakerphone(boolean enabled) Enables or disables the speakerphone temporarily.abstract intsetExtensionProperty(String provider, String extension, ExtensionInfo extensionInfo, String key, String value) Sets the properties of an extension.abstract intsetExtensionProperty(String provider, String extension, String key, String value) Sets the properties of an extension.abstract intsetExtensionProperty(String provider, String extension, String key, String value, Constants.MediaSourceType sourceType) Sets the properties of an extension.abstract intsetExtensionProviderProperty(String provider, String key, String value) Sets the provider property of an extension.abstract intsetExternalAudioSink(boolean enabled, int sampleRate, int channels) Sets the external audio sink.abstract intsetExternalAudioSource(boolean enabled, int sampleRate, int channels) Deprecated.This method is deprecated.abstract intsetExternalAudioSource(boolean enabled, int sampleRate, int channels, boolean localPlayback, boolean publish) Deprecated.This method is deprecated.abstract intsetExternalMediaProjection(MediaProjection mediaProjection) Sets screen sharing using the Android native class MediaProjection.abstract intsetExternalRemoteEglContext(Object eglContext) Set remote eglContext.abstract intsetExternalVideoSource(boolean enable, boolean useTexture, Constants.ExternalVideoSourceType sourceType) Sets the external video source.abstract intsetExternalVideoSource(boolean enable, boolean useTexture, Constants.ExternalVideoSourceType sourceType, EncodedVideoTrackOptions encodedOpt) Sets the external video source.abstract intSets the face shape area options.abstract intsetFaceShapeAreaOptions(FaceShapeAreaOptions options, Constants.MediaSourceType sourceType) Sets the face shape area options.abstract intsetFaceShapeBeautyOptions(boolean enabled, FaceShapeBeautyOptions options) Enables/Disables face shape and sets the beauty options.abstract intsetFaceShapeBeautyOptions(boolean enabled, FaceShapeBeautyOptions options, Constants.MediaSourceType sourceType) Enables/Disables face shape and sets the beauty options.abstract intsetFilterEffectOptions(boolean enabled, FilterEffectOptions options) Sets filter effect option.abstract intsetFilterEffectOptions(boolean enabled, FilterEffectOptions options, Constants.MediaSourceType sourceType) Sets filter effect option.abstract intsetHeadphoneEQParameters(int lowGain, int highGain) Sets the parameters of audio playback effect for remote headphones after remote audio is mixed.abstract intsetHeadphoneEQPreset(int preset) Sets preset audio playback effect for remote headphones after remote audio is mixed.abstract intsetHighPriorityUserList(int[] uidList, int option) Sets the high priority user list and related fallback option for the remotely subscribed video stream based on the network conditions in NASA2.abstract intsetHighQualityAudioParameters(boolean fullband, boolean stereo, boolean fullBitrate) Sets high-quality audio preferences.abstract intsetInEarMonitoringVolume(int volume) Sets the volume of the in-ear monitoring.abstract intset local access point addresses in local proxy mode, use this method before join channel.abstract intsetLocalRenderMode(int renderMode) Deprecated.abstract intsetLocalRenderMode(int renderMode, int mirrorMode) Updates the display mode of the local video view.abstract intsetLocalRenderTargetFps(Constants.VideoSourceType sourceType, int targetFps) Sets the target frames per second (FPS) for the local render target.abstract intsetLocalVideoMirrorMode(int mode) Deprecated.abstract intsetLocalVoiceEqualization(Constants.AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, int bandGain) Sets the local voice equalization effect.abstract intsetLocalVoiceFormant(double formantRatio) Sets the voice formant ratio for local speaker.abstract intsetLocalVoicePitch(double pitch) Sets the voice pitch of the local speaker.abstract intsetLocalVoiceReverb(Constants.AUDIO_REVERB_TYPE reverbKey, int value) Sets the local voice reverberation.abstract intsetLogFile(String filePath) Specifies an SDK output log file.abstract intsetLogFileSize(long fileSizeInKBytes) Sets the log file size (KB).abstract intsetLogFilter(int filter) Sets the output log filter level of the SDK.abstract intsetLogLevel(int level) Sets the output log level of the SDK.abstract intsetLowlightEnhanceOptions(boolean enabled, LowLightEnhanceOptions options) Sets low-light enhancement.abstract intsetLowlightEnhanceOptions(boolean enabled, LowLightEnhanceOptions options, Constants.MediaSourceType sourceType) Sets low-light enhancement.abstract intsetMixedAudioFrameParameters(int sampleRate, int channel, int samplesPerCall) Sets the mixed audio format for theonMixedAudioFramecallback.abstract intsetParameters(String parameters) Provides technical preview functionalities or special customizations by configuring the SDK with JSON options.abstract intsetPlaybackAudioFrameBeforeMixingParameters(int sampleRate, int channel) Sets the audio playback format before mixing for theonPlaybackAudioFrameBeforeMixingcallback.abstract intsetPlaybackAudioFrameBeforeMixingParameters(int sampleRate, int channel, int samplesPerCall) Sets the audio playback format before mixing for theonPlaybackAudioFrameBeforeMixingcallback.abstract intsetPlaybackAudioFrameParameters(int sampleRate, int channel, int mode, int samplesPerCall) Sets the audio recording format for theonPlaybackAudioFramecallback.abstract voidsetPreferHeadset(boolean enabled) Deprecated.This method is deprecated.abstract intsetRecordingAudioFrameParameters(int sampleRate, int channel, int mode, int samplesPerCall) Sets the audio recording format for theonRecordAudioFramecallback.abstract intsetRemoteDefaultVideoStreamType(int streamType) Deprecated.abstract intSets the default stream type of the remote video if the remote user has enabled dual-stream.abstract intsetRemoteRenderMode(int uid, int renderMode) Deprecated.abstract intsetRemoteRenderMode(int uid, int renderMode, int mirrorMode) Updates the display mode of the video view of a remote user.abstract intsetRemoteRenderTargetFps(int targetFps) Sets the target frames per second (FPS) for the remote render target.abstract intsetRemoteSubscribeFallbackOption(int option) Deprecated.abstract intSets the fallback option for the remotely subscribed video stream based on the network conditions.abstract intsetRemoteUserPriority(int uid, int userPriority) Sets the priority of a remote user's media stream.abstract intsetRemoteUserSpatialAudioParams(int uid, SpatialAudioParams params) abstract intsetRemoteVideoStreamType(int uid, int streamType) Deprecated.abstract intsetRemoteVideoStreamType(int uid, Constants.VideoStreamType streamType) Sets the remote video stream type.abstract intsetRemoteVideoSubscriptionOptions(int uid, VideoSubscriptionOptions options) abstract intsetRemoteVoicePosition(int uid, double pan, double gain) Sets the sound position and gain of a remote user.abstract intsetRouteInCommunicationMode(int route) Select preferred route in android communication mode.abstract intsetScreenCaptureScenario(Constants.ScreenScenarioType screenScenario) Sets the screen sharing scenario.abstract intsetSimulcastConfig(SimulcastConfig simulcastConfig) Sets the multi-layer video stream configuration.abstract intsetSubscribeAudioAllowlist(int[] uidList) Sets the allowlist of subscribe remote stream audio.abstract intsetSubscribeAudioBlocklist(int[] uidList) Sets the blocklist of subscribe remote stream audio.abstract intsetSubscribeVideoAllowlist(int[] uidList) Sets the whitelist of subscribe remote stream video.abstract intsetSubscribeVideoBlocklist(int[] uidList) Sets the blocklist of subscribe remote stream video.abstract intsetupAudioAttributes(AudioAttributes attr) 配置AudioAttributeabstract intsetupLocalVideo(VideoCanvas local) Initializes the local video view.abstract intsetupRemoteVideo(VideoCanvas remote) Initializes the video view of a remote user.abstract intsetVideoDenoiserOptions(boolean enabled, VideoDenoiserOptions options) Sets video noise reduction.abstract intsetVideoDenoiserOptions(boolean enabled, VideoDenoiserOptions options, Constants.MediaSourceType sourceType) Sets video noise reduction.abstract intSets the video encoder configuration.abstract intsetVideoQoEPreference(Constants.QoEPreference qoePreference) Sets the video qoe preference.abstract intsetVideoQualityParameters(boolean preferFrameRateOverImageQuality) Sets the video quality preferences.abstract intsetVideoScenario(Constants.VideoScenario scenarioType) You can call this method to set the expected video scenario.abstract intsetVoiceBeautifierParameters(int preset, int param1, int param2) Sets parameters for SDK preset voice beautifier effects.abstract intsetVoiceBeautifierPreset(int preset) Sets an SDK preset voice beautifier effect.abstract intsetVoiceConversionParameters(int preset, int param1, int param2) Set parameters for SDK preset voice conversion.abstract intsetVoiceConversionPreset(int preset) Sets an SDK preset voice conversion effect.abstract intsetVolumeOfEffect(int soundId, double volume) Sets the volume of the specified audio effect.abstract intstartAudioMixing(String filePath, boolean loopback, int cycle) Starts playing and mixing the music file.abstract intstartAudioMixing(String filePath, boolean loopback, int cycle, int startPos) Starts playing and mixing the music file.abstract intstartAudioRecording(io.agora.rtc2.internal.AudioRecordingConfiguration config) Starts an audio recording.abstract intstartAudioRecording(String filePath, int quality) Starts an audio recording.abstract intstartCameraCapture(Constants.VideoSourceType sourceType, CameraCapturerConfiguration config) Starts video capture with a specified camera.abstract intstartDirectCdnStreaming(IDirectCdnStreamingEventHandler eventHandler, String publishUrl, DirectCdnStreamingMediaOptions options) Deprecated.v4.6.0.abstract intstartEchoTest(EchoTestConfiguration config) Starts a video call test.abstract intstartLastmileProbeTest(io.agora.rtc2.internal.LastmileProbeConfig config) 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).abstract intStarts the local audio with a mixed audio stream.abstract intStarts the local video with a transcoding video stream.abstract intabstract intstartOrUpdateChannelMediaRelay(ChannelMediaRelayConfiguration channelMediaRelayConfiguration) Starts or update to relay media streams across channels.abstract intstartPlaybackDeviceTest(String audioFileName) Starts a playback device test.abstract intStarts the local video preview before joining a channel.abstract intstartPreview(Constants.VideoSourceType sourceType) Starts the local video preview before joining a channel.abstract intstartRecordingDeviceTest(int indicationInterval) Starts the microphone test.abstract intstartRhythmPlayer(String sound1, String sound2, AgoraRhythmPlayerConfig config) Enables the rhythm player.abstract intPublishes the local stream without transcoding to a specified CDN live RTMP address.abstract intstartRtmpStreamWithTranscoding(String url, LiveTranscoding transcoding) Publishes the local stream with transcoding to a specified CDN live RTMP address.abstract intstartScreenCapture(ScreenCaptureParameters screenCaptureParameters) Starts screen sharing.abstract intStops playing all audio effects.abstract intStops playing or mixing the music file.abstract intStops the audio recording on the client.abstract intstopCameraCapture(Constants.VideoSourceType sourceType) Stops video capture with a specified camera.abstract intStops the media stream relay.abstract intDeprecated.v4.6.0.abstract intStops an audio call test.abstract intstopEffect(int soundId) Stops playing the specified audio effect.abstract intStops the last-mile network probe test.abstract intStops a mixed audio track.abstract intStops a transcoding video stream.abstract intStops the playback device test.abstract intStops the local video preview and the video.abstract intstopPreview(Constants.VideoSourceType sourceType) Stops the local video preview and the video.abstract intStops the microphone test.abstract intDisables the rhythm player.abstract intstopRtmpStream(String url) Stop an RTMP stream with transcoding or without transcoding from the CDN.abstract intStops screen sharing.abstract intSwitches between front and rear cameras.abstract intswitchCamera(String cameraId) Switches to appoint cameraIdabstract inttakeSnapshot(int uid, SnapshotConfig config) Takes a snapshot of a video stream.abstract inttakeSnapshot(int uid, String filePath) Takes a snapshot of a video stream.abstract intReleases all preloaded audio effects from the memory.abstract intunloadEffect(int soundId) Releases the specific preloaded audio effect from the memory.abstract intReleases the audio spectrum observer.abstract intunregisterMediaMetadataObserver(IMetadataObserver observer, int type) Unregisters the metadata observer.abstract intUpdates the channel media options after joining the channel.abstract intDeprecated.v4.6.0.abstract intUpdate the source stream settings for the mixed audio stream.abstract intUpdate the video layout settings for the transcoding video stream.abstract intupdatePreloadChannelToken(String token) Update token of the preloaded channels.abstract intupdateRtmpTranscoding(LiveTranscoding transcoding) Update the video layout and audio settings for CDN live.abstract intupdateScreenCaptureParameters(ScreenCaptureParameters screenCaptureParameters) Updates the screen sharing configuration.abstract StringUpload current log file immediately to server.abstract intWrite the log to SDK .
-
Constructor Details
-
RtcEngine
public RtcEngine()
-
-
Method Details
-
create
public static RtcEngine create(Context context, String appId, IRtcEngineEventHandler handler) throws Exception Creates anRtcEngineinstance. Unless otherwise specified, all the methods provided by theRtcEngineclass are executed asynchronously. Agora recommends calling these methods in the same thread.- Parameters:
context- The context of Android Activity.appId- The App ID issued to you by Agora. See [How to get the App ID](https://docs.agora.io/en/Agora%20Platform/token#get-an-app-id). Only users in apps with the same App ID can join the same channel and communicate with each other. Use an App ID to create only oneRtcEngineinstance. To change your App ID, call destroy todestroythe currentRtcEngineinstance and then call `create` to create anRtcEngineinstance with the new App ID.handler-IRtcEngineEventHandleris an abstract class providing default implementation. The SDK uses this class to report to the app on SDK runtime events.- Returns:
- - The
RtcEngineinstance, if the method call succeeds. - < 0, if the method call fails. - Throws:
Exception- Fails to create anRtcEngineinstance.
-
create
Creates an RtcEngine instance. The Agora Native SDK only supports one RtcEngine instance at a time, therefore the app should create one RtcEngine object only. Unless otherwise specified: - All called methods provided by the RtcEngine class are executed asynchronously. We recommends calling these methods in the same thread. - The following rule applies to all APIs whose return values are integer types: - 0: The method call succeeds. - < 0: The method call fails.- Parameters:
config- Configurations for the RtcEngine instance. For details, seeRtcEngineConfig.- Returns:
- An RtcEngine object.
- Throws:
Exception- Fails to create an RtcEngine instance.
-
destroy
public static void destroy() -
destroy
- Parameters:
callback- An optional `IRtcEngineReleaseCallback` instance, used to configure synchronous or asynchronous destruction of the engine: - `non-null`: Asynchronous destruction. The method returns immediately, and the engine resources may not be fully released yet. The `onEngineReleased` will be triggered once the engine destruction is complete. - `null`: Synchronous destruction. The method returns only after the engine resources have been fully released.- Since:
- v4.6.0
-
setChannelProfile
public abstract int setChannelProfile(int profile) Sets the channel profile. TheRtcEnginedifferentiates 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.- Parameters:
profile- The channel profile: - `CHANNEL_PROFILE_COMMUNICATION`(0): Communication. Use this profile when there are two users in the channel. - `CHANNEL_PROFILE_LIVE_BROADCASTING`(1): (Default) Live Broadcast.- Returns:
- - 0: Success. - < 0: Failure.
-
setClientRole
public abstract int setClientRole(int role) Sets the role of a user. This method sets the user role as either BROADCASTER or AUDIENCE (default). - The broadcaster sends and receives streams. - The audience receives streams only. 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.- Parameters:
role- The role of the client: - `CLIENT_ROLE_BROADCASTER`(1): The broadcaster. - `CLIENT_ROLE_AUDIENCE(2)`: The audience.- Returns:
- - 0: Success. - < 0: Failure.
-
setClientRole
Sets the role of a user (`LIVE_BROADCASTING` profile only). This method sets the role of a user, such as a host or an audience (default), before joining a channel. This method can be used to switch the user role after a user joins a channel. In the `LIVE_BROADCASTING` profile, when a user switches user roles after joining a channel, a successful setClientRole method call triggers the following callbacks: - The local client:onClientRoleChanged. - The remote client:onUserJoinedoronUserOffline(USER_OFFLINE_BECOME_AUDIENCE).- Parameters:
role- Sets the role of a user: - `CLIENT_ROLE_BROADCASTER`(1): Host. A host can both send and receive streams. - `CLIENT_ROLE_AUDIENCE`(2): Audience, the default role. An audience can only receive streams.options- Client role options of a user, see #ClientRoleOptions.- Returns:
- - 0(ERR_OK): Success. - < 0: Failure. - -1(ERR_FAILED): A general error occurs (no specified reason). - -2(ERR_INVALID_ARGUMENT): The parameter is invalid. - -7(ERR_NOT_INITIALIZED): The SDK is not initialized.
-
sendCustomReportMessage
public abstract int sendCustomReportMessage(String id, String category, String event, String label, int value) Agora supports reporting and analyzing customized messages. This function is in the beta stage with a free trial. The ability provided in its beta test version is reporting a maximum of 10 message pieces within 6 seconds, with each message piece not exceeding 256 bytes. To try out this function, contact [support@agora.io](mailto:support@agora.io) and discuss the format of customized messages with us. -
preloadChannel
Preload a channel. This method enables users to preload a channel. A successful call of this method will reduce the time of joining the same channel. Note: 1. The SDK supports preloading up to 20 channels. Once the preloaded channels exceed the limit, the SDK will keep the latest 20 available. 2. Renew the token of the preloaded channel by calling this method with the same 'channelName' and 'uid'.- Parameters:
token- The token generated on your server for authentication.channelName- 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 character scopes are: - All lowercase English letters: a to z. - All uppercase English letters: A to Z. - All numeric characters: 0 to 9. - The space character. - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".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 232 -1. If the user ID is not assigned (or set to 0), the SDK assigns a random user ID and returns it in the onJoinChannelSuccess callback. Your application must record and maintain the returned user ID, because the SDK does not do so.- Returns:
- - 0: Success. - < 0: Failure. - -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method. - -102: The channel name is invalid. You need to pass in a valid channel name in channelName to preload the channel again.
-
preloadChannelWithUserAccount
public abstract int preloadChannelWithUserAccount(String token, String channelName, String userAccount) Preload a channel. This method enables users to preload a channel. A successful call of this method will reduce the time of joining the same channel. Note: 1. The SDK supports preloading up to 20 channels. Once the preloaded channels exceed the limit, the SDK will keep the latest 20 available. 2. Renew the token of the preloaded channel by calling this method with the same 'channelName' and 'userAccount'.- Parameters:
token- The token generated on your server for authentication.channelName- 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 character scopes are: - All lowercase English letters: a to z. - All uppercase English letters: A to Z. - All numeric characters: 0 to 9. - The space character. - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".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: - All lowercase English letters: a to z. - All uppercase English letters: A to Z. - All numeric characters: 0 to 9. - The space character. - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".- Returns:
- - 0: Success. - < 0: Failure. - -2: The parameter is invalid. For example, the userAccount parameter is empty. You need to pass in a valid parameter and preload the channel again. - -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method. - -102: The channel name is invalid. You need to pass in a valid channel name in channelName to preload the channel again.
-
updatePreloadChannelToken
Update token of the preloaded channels. An easy way to update all preloaded channels' tokens, if all preloaded channels use the same token. If preloaded channels use different tokens, we need to call the 'preloadChannel' method with the same 'channelName' and 'uid' or 'userAccount' to update the corresponding token.- Parameters:
token- The token generated on your server for authentication.- Returns:
- - 0: Success. - < 0: Failure. - -2: The token is invalid. You need to pass in a valid token and update the token again. - -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
-
joinChannel
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. Once in a call, the user must call theleaveChannelmethod to exit the current call before entering another channel.- Parameters:
token- The token for authentication. - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#get-a-temporary-token). - In situations requiring high security: Set it as the token generated at you server. For details, see [Generate a token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#get-a-token).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: - All lowercase English letters: a to z. - All uppercase English letters: A to Z. - All numeric characters: 0 to 9. - The space character. - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".optionalInfo- (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 {@link IRtcEngine::onJoinChannelSuccess onJoinChannelSuccess} callback. Your app must record and maintain the returned value as the SDK does not maintain it.- Returns:
- - 0: Success. - < 0: Failure.
-
joinChannel
public abstract int joinChannel(String token, String channelId, int uid, ChannelMediaOptions options) 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. Once in a call, the user must call theleaveChannelmethod to exit the current call before entering another channel.- Parameters:
token- The token for authentication. - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#get-a-temporary-token). - In situations requiring high security: Set it as the token generated at you server. For details, see [Generate a token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#get-a-token).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: - All lowercase English letters: a to z. - All uppercase English letters: A to Z. - All numeric characters: 0 to 9. - The space character. - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".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 theonJoinChannelSuccesscallback. Your app must record and maintain the returned value as the SDK does not maintain it.options- The channel media options:ChannelMediaOptions.- Returns:
- - 0: Success. - < 0: Failure.
-
registerLocalUserAccount
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 \ref agora::rtc::IRtcEngineEventHandler::onLocalUserRegistered "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: - Call the \ref agora::rtc::IRtcEngine::registerLocalUserAccount "registerLocalUserAccount" method to create a user account, and then the \ref agora::rtc::IRtcEngine::joinChannelWithUserAccount "joinChannelWithUserAccount" method to join the channel. - Call the \ref agora::rtc::IRtcEngine::joinChannelWithUserAccount "joinChannelWithUserAccount" method to join the channel. The difference between the two is that for the former, the time elapsed between calling the \ref agora::rtc::IRtcEngine::joinChannelWithUserAccount "joinChannelWithUserAccount" method and joining the channel is shorter than the latter.- Parameters:
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: - All lowercase English letters: a to z. - All uppercase English letters: A to Z. - All numeric characters: 0 to 9. - The space character. - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".- Returns:
- - 0: Success. - < 0: Failure.
-
joinChannelWithUserAccount
public abstract int joinChannelWithUserAccount(String token, String channelName, String userAccount) Joins the channel with a user account. After the user successfully joins the channel, the SDK triggers the following callbacks: - The local client: \ref agora::rtc::IRtcEngineEventHandler::onLocalUserRegistered "onLocalUserRegistered" and \ref agora::rtc::IRtcEngineEventHandler::onJoinChannelSuccess "onJoinChannelSuccess" . The remote client: \ref agora::rtc::IRtcEngineEventHandler::onUserJoined "onUserJoined" and \ref agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" , if the user joining the channel is in the `COMMUNICATION` profile, or is a host in the `LIVE_BROADCASTING` profile.- Parameters:
token- The token generated at your server: - For low-security requirements: You can use the temporary token generated at Console. For details, see [Get a temporary toke](https://docs.agora.io/en/Voice/token?platform=All%20Platforms#get-a-temporary-token). - For high-security requirements: Set it as the token generated at your server. For details, see [Get a token](https://docs.agora.io/en/Voice/token?platform=All%20Platforms#get-a-token).channelName- The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are: - All lowercase English letters: a to z. - All uppercase English letters: A to Z. - All numeric characters: 0 to 9. - The space character. - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".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: - All lowercase English letters: a to z. - All uppercase English letters: A to Z. - All numeric characters: 0 to 9. - The space character. - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".options- The channel media options: \ref agora::rtc::ChannelMediaOptions::ChannelMediaOptions "ChannelMediaOptions"- Returns:
- - 0: Success. - < 0: Failure. - #ERR_INVALID_ARGUMENT (-2) - #ERR_NOT_READY (-3) - #ERR_REFUSED (-5)
-
joinChannelWithUserAccount
public abstract int joinChannelWithUserAccount(String token, String channelName, String userAccount, ChannelMediaOptions options) Joins the channel with a user account, and configures whether to automatically subscribe to audio or video streams after joining the channel.- Parameters:
token- The token generated at your server. For details, see [Generate a token](https://docs.agora.io/en/Interactive Broadcast/token_server?platform=Android).channelName- The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are: - All lowercase English letters: a to z. - All uppercase English letters: A to Z. - All numeric characters: 0 to 9. - The space character. - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".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. - All lowercase English letters: a to z. - All uppercase English letters: A to Z. - All numeric characters: 0 to 9. - The space character. - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".options- The channel media options:ChannelMediaOptions.- Returns:
- - 0: Success.
- < 0: Failure.
-
ERR_INVALID_ARGUMENT(-2)-ERR_NOT_READY(-3)-ERR_REFUSED(-5) - Since:
- v3.3.0.
After the user successfully joins the channel, the SDK triggers the following callbacks:
- The local client:
onLocalUserRegisteredandonJoinChannelSuccess. - The remote client:onUserJoinedandonUserInfoUpdated, if the user joining the channel is in the `COMMUNICATION` profile, or is a host in the `LIVE_BROADCASTING` profile.
-
getUserInfoByUserAccount
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 \ref agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" callback on the local client. After receiving the o\ref agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" 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.- Parameters:
userAccount- The user account of the user. Ensure that you set this parameter.userInfo- A userInfo object that identifies the user- Returns:
- - 0: Success. - < 0: Failure.
-
getUserInfoByUid
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 \ref agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated "onUserInfoUpdated" callback on the local client. After receiving the \ref agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated "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.- Parameters:
uid- The user ID of the remote user. Ensure that you set this parameter.userInfo- A userInfo object that identifies the user- Returns:
- - 0: Success. - < 0: Failure.
-
leaveChannel
public abstract int leaveChannel()Leaves the channel. This method allows a user to leave the channel, for example, by hanging up or exiting a call. After joining a channel, the user must call this method to end the current call before joining another one. This method also releases all resources related to the 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 theonLeaveChannelcallback.- Returns:
- - 0: Success. - < 0: Failure.
-
leaveChannel
Leaves the channel.- Parameters:
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 \ref IRtcEngineEventHandler::onLeaveChannel "onLeaveChannel" callback.- Returns:
- - 0: Success. - < 0: Failure.
-
renewToken
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. The SDK triggers the @link IRtcEngineEventHandler#onRenewTokenResult onRenewTokenResult} callback after the token is renewed. - TheonTokenPrivilegeWillExpirecallback is triggered; - TheonRequestTokencallback is triggered; - The `ERR_TOKEN_EXPIRED(-109)` error is reported.- Parameters:
token- The new token.- Returns:
- - 0: Success. - < 0: Failure.
-
getAudioDeviceInfo
Gets the the Audio device Info- Returns:
- deviceInfo - not null: Success. - null: Failure.
-
enableWebSdkInteroperability
public abstract int enableWebSdkInteroperability(boolean enabled) 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.- Parameters:
enabled- Determines whether to enable interoperability with the Agora Web SDK. - true: Enable interoperability with the Agora Native SDK. - false: Disable interoperability with the Agora Native SDK.- Returns:
- - 0: Success. - < 0: Failure.
-
getConnectionState
public abstract int getConnectionState()Gets the connection state of the SDK.- Returns:
- The connection state:
-
CONNECTION_STATE_DISCONNECTED(1): The SDK is disconnected from Agora's edge server. -CONNECTION_STATE_CONNECTING(2): The SDK is connecting to Agora's edge server. -CONNECTION_STATE_CONNECTED(3): The SDK joined a channel and is connected to Agora's edge server. You can now publish or subscribe to a media stream in the channel. -CONNECTION_STATE_RECONNECTING(4): The SDK keeps rejoining the channel after being disconnected from a joined channel because of network issues. -CONNECTION_STATE_FAILED(5): The SDK fails to join the channel.
-
enableAudio
public abstract int enableAudio()Enables the audio. The audio is enabled by default.- Returns:
- - 0: Success. - < 0: Failure.
-
disableAudio
public abstract int disableAudio()Disables the audio.- Returns:
- - 0: Success. - < 0: Failure.
-
pauseAudio
public abstract int pauseAudio()Disables the audio function in the channel.Note: This method controls the underlying states of the Engine. It is still valid after one leaves channel.
- Returns:
- 0: Success.
- <0: Failure.
-
resumeAudio
public abstract int resumeAudio()Enables the audio function in the channel.- Returns:
- 0: Success.
- <0: Failure.
-
setAudioProfile
public abstract int setAudioProfile(int profile) Sets the audio profile.- Parameters:
profile- Sets the sample rate, bitrate, encoding mode, and the number of channels. SeeAudioProfile.- Returns:
- - 0: Success. - < 0: Failure.
-
setAudioProfile
public abstract int setAudioProfile(int profile, int scenario) Sets the audio parameters and application scenarios.- Parameters:
profile- Sets the sample rate, bitrate, encoding mode, and the number of channels. SeeAudioProfile.scenario- Sets the audio application scenarios. SeeAudioScenario.- Returns:
- - 0: Success. - < 0: Failure.
-
setAudioScenario
public abstract int setAudioScenario(int scenario) -
setHighQualityAudioParameters
public abstract int setHighQualityAudioParameters(boolean fullband, boolean stereo, boolean fullBitrate) Sets high-quality audio preferences.
Call this method and set all the modes before joining a channel. Do NOT call this method again after joining a channel.
Note: Agora does not recommend using this method. If you want to set the audio profile, see
setAudioProfile.- Parameters:
fullband- Full-band codec (48 kHz sampling rate), not compatible with versions before v1.7.4.- True: Enable full-band codec.
- False: Disable full-band codec.
stereo- Stereo codec, not compatible with versions before v1.7.4.- True: Enable stereo codec.
- False: Disable stereo codec.
fullBitrate- High bitrate. Recommended in voice-only mode.- True: Enable high bitrate mode.
- False: Disable high bitrate mode.
- Returns:
- 0: Success.
- <0: Failure.
-
adjustRecordingSignalVolume
public abstract int adjustRecordingSignalVolume(int volume) Adjusts the recording volume.- Parameters:
volume- Recording volume, ranges from 0 to 400:- 0: Mute
- 100: Original volume
- 400: (Maximum) Four times the original volume with signal clipping protection
- Returns:
- 0: Success.
- <0: Failure.
-
adjustPlaybackSignalVolume
public abstract int adjustPlaybackSignalVolume(int volume) Adjusts the playback volume.- Parameters:
volume- Playback volume, ranges from 0 to 400:- 0: Mute
- 100: Original volume
- 400: (Maximum) Four times the original volume with signal clipping protection
- Returns:
- 0: Success.
- <0: Failure.
-
enableAudioVolumeIndication
public abstract int enableAudioVolumeIndication(int interval, int smooth, boolean reportVad) Enables the `onAudioVolumeIndication` callback to report on which users are speaking and the speakers' volume. Once theonAudioVolumeIndicationcallback 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.- Parameters:
interval- Sets the time interval between two consecutive volume indications: - <= 0: Disables the volume indication. - > 0: Time interval (ms) between two consecutive volume indications, and should be integral multiple of 200 (less than 200 will be set to 200).smooth- The smoothing factor that sets the sensitivity of the audio volume indicator. The value ranges is [0, 10]. The greater the value, the more sensitive the indicator. The recommended value is 3.- Returns:
- - 0: Success. - < 0: Failure.
-
enableLocalAudio
public abstract int enableLocalAudio(boolean enabled) 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.- Parameters:
enabled- Determines whether to disable or re-enable the local audio function: - true: (Default) Re-enable the local audio function, that is, to start local audio capture and processing. - false: Disable the local audio function, that is, to stop local audio capture and processing.- Returns:
- - 0: Success. - < 0: Failure.
-
muteLocalAudioStream
public abstract int muteLocalAudioStream(boolean muted) Stops or resumes sending the local audio stream.- Parameters:
muted- Determines whether to send or stop sending the local audio stream: - true: Stop sending the local audio stream. - false: (Default) Send the local audio stream.- Returns:
- - 0: Success. - < 0: Failure.
-
muteRemoteAudioStream
public abstract int muteRemoteAudioStream(int uid, boolean muted) Stops or resumes receiving the audio stream of a specified user. You can call this method before or after joining a channel. If a user leaves a channel, the settings in this method become invalid.- Parameters:
uid- The ID of the specified user.muted- Whether to stop receiving the audio stream of the specified user: - true: Stop receiving the specified audio stream. - false: (Default) Receive the specified audio stream.- Returns:
- - 0: Success. - < 0: Failure.
-
adjustUserPlaybackSignalVolume
public abstract int adjustUserPlaybackSignalVolume(int uid, int volume) Adjust the playback volume of the user specified by uid. You can call this method to adjust the playback volume of the user specified by uid in call. If you want to adjust playback volume of the multi user, you can call this this method multi times.- Parameters:
uid- Remote user ID.volume- The playback volume, range is [0,100]: 0: mute, 100: The original volume- Returns:
- - 0: Success. - < 0: Failure.
-
muteAllRemoteAudioStreams
public abstract int muteAllRemoteAudioStreams(boolean muted) Stops or resumes receiving all remote audio streams. 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. - Ensure that you call this method after joining a channel. - If you call `muteAllRemoteAudioStreams(true)` after joining a channel, the local use stops receiving any audio stream from any user in the channel, including any user who joins the channel after you call this method. - If you call `muteAllRemoteAudioStreams(true)` after leaving a channel, the local user does not receive any audio stream the next time the user joins a channel. After you successfully call `muteAllRemoteAudioStreams(true)`, you can take the following actions: - To resume receiving all remote audio streams, call `muteAllRemoteAudioStreams(false)`. - To resume receiving the audio stream of a specified user, call `muteRemoteAudioStream(uid, false)`, where `uid` is the ID of the user whose audio stream you want to resume receiving.- Parameters:
muted- Whether to stop receiving remote audio streams: - true: Stop receiving any remote audio stream. - false: (Default) Resume receiving all remote audio streams.- Returns:
- - 0: Success. - < 0: Failure.
-
enableVideo
public abstract int enableVideo()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.- Returns:
- - 0: Success. - < 0: Failure.
-
disableVideo
public abstract int disableVideo()Disables the video. This method stops capturing the local video and receiving any remote video. To enable the local preview function, callenableLocalVideo(true).- Returns:
- - 0: Success. - < 0: Failure.
-
setVideoEncoderConfiguration
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.- Parameters:
config- The local video encoder configuration: VideoEncoderConfiguration.- Returns:
- - 0: Success. - < 0: Failure.
-
queryCodecCapability
queryCodecCapability. query current device codec capacity. and will return actual codecCapInfo. -
queryDeviceScore
public abstract int queryDeviceScore()Queries the score of the current device.- Returns:
- > 0: The score of the current device. Most devices score between 60-100, with higher scores indicating better performance. < 0: Failure.
-
queryCameraFocalLengthCapability
Query all focal attributes supported by the camera.- Returns:
- - AgoraFocalLengthInfo: The camera supports the collection of focal segments.
-
setCameraCapturerConfiguration
Sets the camera capturer configuration.- Parameters:
config- The camera capturer configuration. For details, seeCameraCapturerConfiguration.- Returns:
- - 0: Success. - < 0: Failure.
-
setupLocalVideo
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`.- Parameters:
local- The local video view setting: VideoCanvas.- Returns:
- - 0: Success. - < 0: Failure.
-
setupRemoteVideo
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 theonUserJoinedcallback. To unbind the remote user from the view, set `view` in VideoCanvas as `null`.- Parameters:
remote- The remote video view settings:VideoCanvas.- Returns:
- - 0: Success. - < 0: Failure.
-
setRemoteRenderMode
Deprecated.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.- Parameters:
uid- ID of the remote user.renderMode- Sets the remote display mode: - `RENDER_MODE_HIDDEN`(1): Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents. - `RENDER_MODE_FIT`(2): Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to the disparity in the aspect ratio will be filled with black.- Returns:
- - 0: Success. - < 0: Failure.
-
setLocalRenderMode
Deprecated.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.- Parameters:
renderMode- Sets the local display mode: - `RENDER_MODE_HIDDEN`(1): Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents. - `RENDER_MODE_FIT`(2): Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to the disparity in the aspect ratio will be filled with black.- Returns:
- - 0: Success. - < 0: Failure.
-
setRemoteRenderMode
public abstract int setRemoteRenderMode(int uid, int renderMode, int mirrorMode) 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.- Parameters:
uid- ID of the remote user.renderMode- Sets the remote display mode: - `RENDER_MODE_HIDDEN`(1): Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents. - `RENDER_MODE_FIT`(2): Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to the disparity in the aspect ratio will be filled with black.mirrorMode- Sets the remote video mirror mode: - `VIDEO_MIRROR_MODE_ENABLED(1)`: Enable the mirror mode. - `VIDEO_MIRROR_MODE_DISABLED(2)`: Disable the mirror mode.- Returns:
- - 0: Success. - < 0: Failure.
-
setLocalRenderMode
public abstract int setLocalRenderMode(int renderMode, int mirrorMode) 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.- Parameters:
renderMode- Sets the local display mode: - `RENDER_MODE_HIDDEN`(1): Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents. - `RENDER_MODE_FIT`(2): Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to the disparity in the aspect ratio will be filled with black.mirrorMode- Sets the local video mirror mode: - `VIDEO_MIRROR_MODE_AUTO(0)`: (Default) The mirror mode determined by the SDK. If you use the front camera, the SDK enables the mirror mode; if you use the rear camera, the SDK disables the mirror mode. - `VIDEO_MIRROR_MODE_ENABLED(1)`: Enable the mirror mode. - `VIDEO_MIRROR_MODE_DISABLED(2)`: Disable the mirror mode.- Returns:
- - 0: Success. - < 0: Failure.
-
startPreview
public abstract int startPreview()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 callingleaveChannel, the local video preview remains until you callstopPreviewto disable it.- Returns:
- 0: Success.
- <0: Failure.
-
startPreview
Starts the local video preview before joining a channel.- Parameters:
sourceType- - The video source type.
-
stopPreview
public abstract int stopPreview()Stops the local video preview and the video.- Returns:
- - 0: Success. - < 0: Failure.
-
stopPreview
Stops the local video preview and the video.- Parameters:
sourceType- - The video source type.
-
enableLocalVideo
public abstract int enableLocalVideo(boolean enabled) Disables or re-enables the local video capture. Once you enable the video usingenableVideo, 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.- Parameters:
enabled- Determines whether to disable or re-enable the local video, including the capturer, renderer, and sender: - true: (Default) Re-enable the local video. - false: Disable the local video. Once the local video is disabled, the remote users can no longer receive the video stream of this user, while this user can still receive the video streams of other remote users. When you set `enabled` as `false`, this method does not require a local camera.- Returns:
- - 0: Success. - < 0: Failure.
-
startCameraCapture
public abstract int startCameraCapture(Constants.VideoSourceType sourceType, CameraCapturerConfiguration config) Starts video capture with a specified camera.- Parameters:
sourceType- - The video source type.config- - Camera capture configuration. See #CameraCapturerConfiguration.
-
stopCameraCapture
Stops video capture with a specified camera.- Parameters:
sourceType- - The video source type.
-
startLocalVideoTranscoder
Starts the local video with a transcoding video stream.- Parameters:
config- Sets the transcoding video stream layout settings. See LocalTranscoderConfiguration.- Returns:
- - 0: Success. - < 0: Failure. - #ERR_NOT_INITIALIZED (7): You have not initialized the RTC engine when publishing the stream.
-
stopLocalVideoTranscoder
public abstract int stopLocalVideoTranscoder()Stops a transcoding video stream.- Returns:
- - 0: Success. - < 0: Failure. - #ERR_NOT_INITIALIZED (7): You have not initialized the RTC engine when publishing the stream.
-
updateLocalTranscoderConfiguration
Update the video layout settings for the transcoding video stream.- Parameters:
config- Update the transcoding video stream layout settings. See LocalTranscoderConfiguration.- Returns:
- - 0: Success. - < 0: Failure. - #ERR_NOT_INITIALIZED (7): You have not initialized the RTC engine when publishing the stream.
-
startLocalAudioMixer
Starts the local audio with a mixed audio stream.- Parameters:
config- Sets the mixed audio stream source settings.- Returns:
- - 0: Success. - < 0: Failure. - #ERR_NOT_INITIALIZED (7): You have not initialized the RTC engine when publishing the stream.
-
updateLocalAudioMixerConfiguration
Update the source stream settings for the mixed audio stream.- Parameters:
config- Update the source audio stream settings. See- Returns:
- - 0: Success. - < 0: Failure. - #ERR_NOT_INITIALIZED (7): You have not initialized the RTC engine when publishing the stream.
-
stopLocalAudioMixer
public abstract int stopLocalAudioMixer()Stops a mixed audio track.- Returns:
- - 0: Success. - < 0: Failure. - #ERR_NOT_INITIALIZED (7): You have not initialized the RTC engine when publishing the stream.
-
muteLocalVideoStream
public abstract int muteLocalVideoStream(boolean muted) Stops or resumes sending the local video stream.- Parameters:
muted- Determines whether to send or stop sending the local video stream: - true: Stop sending the local video stream. - false: (Default) Send the local video stream.- Returns:
- - 0: Success. - < 0: Failure.
-
muteRemoteVideoStream
public abstract int muteRemoteVideoStream(int uid, boolean muted) Stops or resumes receiving the video stream of a specified user. You can call this method before or after joining a channel. If a user leaves a channel, the settings in this method become invalid.- Parameters:
uid- The ID of the specified user.muted- Whether to stop receiving the video stream of the specified user: - true: Stop receiving the video stream of the specified user. - false: (Default) Resume receiving the video stream of the specified user.- Returns:
- - 0: Success. - < 0: Failure.
-
muteAllRemoteVideoStreams
public abstract int muteAllRemoteVideoStreams(boolean muted) 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. Ensure that you call this method after joining a channel. - If you call `muteAllRemoteVideoStreams(true)` after joining a channel, the local use stops receiving any video stream from any user in the channel, including any user who joins the channel after you call this method. - If you call `muteAllRemoteVideoStreams(true)` after leaving a channel, the local user does not receive any video stream the next time the user joins a channel. After you successfully call `muteAllRemoteVideoStreams(true)`, you can take the following actions: - To resume receiving all remote video streams, call `muteAllRemoteVideoStreams(false)`. - To resume receiving the video stream of a specified user, call `muteRemoteVideoStream(uid, false)`, where `uid` is the ID of the user whose video stream you want to resume receiving.- Parameters:
muted- Whether to stop receiving remote video streams: - true: Stop receiving any remote video stream. - false: (Default) RResume receiving all remote video streams.- Returns:
- - 0: Success. - < 0: Failure.
-
setBeautyEffectOptions
Enables/Disables image enhancement and sets the options.- Parameters:
enabled- Whether to enable image enhancement: - `true`: Enables image enhancement. - `false`: Disables image enhancement.options- The image enhancement options. SeeBeautyOptions.- Returns:
- - 0: Success. - < 0: Failure. - ERR_NOT_SUPPORTED(4): The system version is earlier than Android 4.4, which does not support this function.
- Since:
- v2.4.0.
-
setBeautyEffectOptions
public abstract int setBeautyEffectOptions(boolean enabled, BeautyOptions options, Constants.MediaSourceType sourceType) Enables/Disables image enhancement and sets the options.- Parameters:
enabled- Whether to enable image enhancement: - `true`: Enables image enhancement. - `false`: Disables image enhancement.options- The image enhancement options. SeeBeautyOptions.sourceType- The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. SeeConstants#MediaSourceType.- Returns:
- - 0: Success. - < 0: Failure. - ERR_NOT_SUPPORTED(4): The system version is earlier than Android 4.4, which does not support this function.
- Since:
- v2.4.0.
-
setFaceShapeBeautyOptions
Enables/Disables face shape and sets the beauty options.- Parameters:
enabled- Whether to enable face shape: - `true`: Enables face shape. - `false`: Disables face shape.options- The face shape beauty options. SeeFaceShapeBeautyOptions.- Returns:
- - 0: Success. - < 0: Failure. - ERR_NOT_SUPPORTED(4): The system version is earlier than Android 4.4, which does not support this function.
-
setFaceShapeBeautyOptions
public abstract int setFaceShapeBeautyOptions(boolean enabled, FaceShapeBeautyOptions options, Constants.MediaSourceType sourceType) Enables/Disables face shape and sets the beauty options.- Parameters:
enabled- Whether to enable face shape: - `true`: Enables face shape. - `false`: Disables face shape.options- The face shape beauty options. SeeFaceShapeBeautyOptions.sourceType- The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. SeeConstants#MediaSourceType.- Returns:
- - 0: Success. - < 0: Failure. - ERR_NOT_SUPPORTED(4): The system version is earlier than Android 4.4, which does not support this function.
-
getFaceShapeBeautyOptions
Gets the face shape beauty options.- Returns:
- FaceShapeBeautyOptions
-
getFaceShapeBeautyOptions
public abstract FaceShapeBeautyOptions getFaceShapeBeautyOptions(Constants.MediaSourceType sourceType) Gets the face shape beauty options.- Parameters:
sourceType- The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. SeeConstants#MediaSourceType.- Returns:
- FaceShapeBeautyOptions
-
setFaceShapeAreaOptions
Sets the face shape area options.- Parameters:
options- The face shape area options. SeeFaceShapeAreaOptions.- Returns:
- - 0: Success. - < 0: Failure. - ERR_NOT_SUPPORTED(4): The system version is earlier than Android 4.4, which does not support this function.
-
setFaceShapeAreaOptions
public abstract int setFaceShapeAreaOptions(FaceShapeAreaOptions options, Constants.MediaSourceType sourceType) Sets the face shape area options.- Parameters:
options- The face shape area options. SeeFaceShapeAreaOptions.sourceType- The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. SeeConstants#MediaSourceType.- Returns:
- - 0: Success. - < 0: Failure. - ERR_NOT_SUPPORTED(4): The system version is earlier than Android 4.4, which does not support this function.
-
getFaceShapeAreaOptions
Gets the face shape area options.- Parameters:
shapeArea- The face shape area. SeeFaceShapeAreaOptions.- Returns:
- FaceShapeAreaOptions
-
getFaceShapeAreaOptions
public abstract FaceShapeAreaOptions getFaceShapeAreaOptions(int shapeArea, Constants.MediaSourceType sourceType) Gets the face shape area options.- Parameters:
shapeArea- The face shape area. SeeFaceShapeAreaOptions.sourceType- The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. SeeConstants#MediaSourceType.- Returns:
- FaceShapeAreaOptions
-
setFilterEffectOptions
Sets filter effect option.- Parameters:
enabled- Whether to enable filter beauty: - `true`: Enabled. - `false`: (Default) Disabled.options- The filter effect options. SeeFilterEffectOptions.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v4.4.1 You can call this method to enable the filter effect feature and set the options of the filter effect.
-
setFilterEffectOptions
public abstract int setFilterEffectOptions(boolean enabled, FilterEffectOptions options, Constants.MediaSourceType sourceType) Sets filter effect option.- Parameters:
enabled- Whether to enable filter beauty: - `true`: Enabled. - `false`: (Default) Disabled.options- The filter effect options. SeeFilterEffectOptions.sourceType- The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. SeeConstants#MediaSourceType.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v4.4.1.
-
setLowlightEnhanceOptions
Sets low-light enhancement.- Parameters:
enabled- Sets whether to enable low-light enhancement: - `true`: Enable. - `false`: (Default) Disable.options- The low-light enhancement options. SeeLowLightEnhanceOptions.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v3.6.2 The low-light enhancement feature can adaptively adjust the brightness value of the video captured in situations with low or uneven lighting, such as backlit, cloudy, or dark scenes. It restores or highlights the image details and improves the overall visual effect of the video. You can call this method to enable the low-light enhancement feature and set the options of the low-light enhancement effect.
-
setLowlightEnhanceOptions
public abstract int setLowlightEnhanceOptions(boolean enabled, LowLightEnhanceOptions options, Constants.MediaSourceType sourceType) Sets low-light enhancement.- Parameters:
enabled- Sets whether to enable low-light enhancement: - `true`: Enable. - `false`: (Default) Disable.options- The low-light enhancement options. SeeLowLightEnhanceOptions.sourceType- The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. SeeConstants#MediaSourceType.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v3.6.2 The low-light enhancement feature can adaptively adjust the brightness value of the video captured in situations with low or uneven lighting, such as backlit, cloudy, or dark scenes. It restores or highlights the image details and improves the overall visual effect of the video. You can call this method to enable the low-light enhancement feature and set the options of the low-light enhancement effect.
-
setVideoDenoiserOptions
Sets video noise reduction.- Parameters:
enabled- Sets whether to enable video noise reduction: - `true`: Enable. - `false`: (Default) Disable.options- The video noise reduction options. SeeVideoDenoiserOptions.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v3.6.2 Underlit environments and low-end video capture devices can cause video images to contain significant noise, which affects video quality. In real-time interactive scenarios, video noise also consumes bitstream resources and reduces encoding efficiency during encoding. You can call this method to enable the video noise reduction feature and set the options of the video noise reduction effect.
-
setVideoDenoiserOptions
public abstract int setVideoDenoiserOptions(boolean enabled, VideoDenoiserOptions options, Constants.MediaSourceType sourceType) Sets video noise reduction.- Parameters:
enabled- Sets whether to enable video noise reduction: - `true`: Enable. - `false`: (Default) Disable.options- The video noise reduction options. SeeVideoDenoiserOptions.sourceType- The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. SeeConstants#MediaSourceType.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v3.6.2 Underlit environments and low-end video capture devices can cause video images to contain significant noise, which affects video quality. In real-time interactive scenarios, video noise also consumes bitstream resources and reduces encoding efficiency during encoding. You can call this method to enable the video noise reduction feature and set the options of the video noise reduction effect.
-
setColorEnhanceOptions
Sets color enhancement.- Parameters:
enabled- Sets whether to enable color enhancement: - `true`: Enable. - `false`: (Default) Disable.options- The color enhancement options. SeeColorEnhanceOptions.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v3.6.2 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.
-
setColorEnhanceOptions
public abstract int setColorEnhanceOptions(boolean enabled, ColorEnhanceOptions options, Constants.MediaSourceType sourceType) Sets color enhancement.- Parameters:
enabled- Sets whether to enable color enhancement: - `true`: Enable. - `false`: (Default) Disable.options- The color enhancement options. SeeColorEnhanceOptions.sourceType- The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. SeeConstants#MediaSourceType.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v3.6.2 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.
-
createVideoEffectObject
public abstract IVideoEffectObject createVideoEffectObject(String bundlePath, Constants.MediaSourceType sourceType) - Parameters:
bundlePath- The path of the video effect bundle.sourceType- The media source type, e.g. PRIMARY_CAMERA_SOURCE. SeeConstants#MediaSourceType.- Returns:
- - IVideoEffectObject: Success. - null: Failure.
- Since:
- v4.6.0
-
destroyVideoEffectObject
- Parameters:
videoEffectObject- The video effect object to be destroyed.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v4.6.0
-
enableVirtualBackground
public abstract int enableVirtualBackground(boolean enabled, VirtualBackgroundSource backgroundSource, SegmentationProperty segproperty) Enables/Disables portrait segmentation and repalce the background(not portrait area) with specified source.- Parameters:
enabled- Sets whether or not to enable capture image background subtitution: - true: enables background subtitution. - false: disables background subtitution.backgroundSource- Sets the background source data. SeeVirtualBackgroundSource.segproperty-- Returns:
- - 0: Success. - < 0: Failure. VIRTUAL_BACKGROUND_SOURCE_STATE_REASON_IMAGE_NOT_EXIST = -1, VIRTUAL_BACKGROUND_SOURCE_STATE_REASON_COLOR_FORMAT_NOT_SUPPORTED = -2, VIRTUAL_BACKGROUND_SOURCE_STATE_REASON_DEVICE_NOT_SUPPORTED = -3,
-
enableVirtualBackground
public abstract int enableVirtualBackground(boolean enabled, VirtualBackgroundSource backgroundSource, SegmentationProperty segproperty, Constants.MediaSourceType sourceType) Enables/Disables portrait segmentation and repalce the background(not portrait area) with specified source.- Parameters:
enabled- Sets whether or not to enable capture image background subtitution: - true: enables background subtitution. - false: disables background subtitution.VirtualBackgroundSource- Sets the background source data. SeeVirtualBackgroundSource.SegmentationProperty-sourceType- The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. SeeConstants#MediaSourceType.- Returns:
- - 0: Success. - < 0: Failure. VIRTUAL_BACKGROUND_SOURCE_STATE_REASON_IMAGE_NOT_EXIST = -1, VIRTUAL_BACKGROUND_SOURCE_STATE_REASON_COLOR_FORMAT_NOT_SUPPORTED = -2, VIRTUAL_BACKGROUND_SOURCE_STATE_REASON_DEVICE_NOT_SUPPORTED = -3,
-
setDefaultAudioRoutetoSpeakerphone
public abstract int setDefaultAudioRoutetoSpeakerphone(boolean defaultToSpeaker) Sets the default audio route. 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: - Voice call: Earpiece. - Video call: Speakerphone. - Audio broadcast: Speakerphone. - Video broadcast: Speakerphone. Call this method before, during, or after a call, to change the default audio route. When the audio route changes, the SDK triggers theonAudioRouteChangedcallback.- Parameters:
defaultToSpeaker- Whether to set the speakerphone as the default audio route: - true: Set the speakerphone as the default audio route. - false: Do not set the speakerphone as the default audio route.- Returns:
- - 0: Success. - < 0: Failure.
-
setEnableSpeakerphone
public abstract int setEnableSpeakerphone(boolean enabled) Enables or disables the speakerphone temporarily. When the audio route changes, the SDK triggers theonAudioRouteChangedcallback. 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.- Parameters:
enabled- Whether to set the speakerphone as the temporary audio route: - true: Set the speakerphone as the audio route temporarily. - false: Do not set the speakerphone as the audio route.- Returns:
- - 0: Success. - <0: Failure.
-
setRouteInCommunicationMode
public abstract int setRouteInCommunicationMode(int route) Select preferred route in android communication mode.- Parameters:
route- The preferred route. For example, when a Bluetooth headset is connected, you can use this API to switch the route to a wired headset.- Returns:
- meanless, route switch result is pass through CallbackOnRoutingChanged
-
isSpeakerphoneEnabled
public abstract boolean isSpeakerphoneEnabled()Checks whether the speakerphone is enabled.- Returns:
- - true: The speakerphone is enabled, and the audio plays from the speakerphone. - false: The speakerphone is not enabled, and the audio plays from devices other than the speakerphone. For example, the headset or earpiece.
-
enableInEarMonitoring
public abstract int enableInEarMonitoring(boolean enabled) Enables in-ear monitoring.- Parameters:
enabled- Determines whether to enable in-ear monitoring. - true: Enable in-ear monitoring. - false: Disable in-ear monitoring.- Returns:
- - 0: Success. - < 0: Failure.
-
enableInEarMonitoring
public abstract int enableInEarMonitoring(boolean enabled, int includeAudioFilters) Enables in-ear monitoring.- Parameters:
enabled- Determines whether to enable in-ear monitoring. - true: Enable in ear monitoring. - false: Disable in ear monitoring.includeAudioFilters- The type of the ear monitoring- Returns:
- - 0: Success. - < 0: Failure.
-
setInEarMonitoringVolume
public abstract int setInEarMonitoringVolume(int volume) Sets the volume of the in-ear monitoring.- Parameters:
volume- The volume of the in-ear monitor, ranging from 0 to 100. The default value is 100.- Returns:
- - 0: Success. - < 0: Failure.
-
setLocalVoicePitch
public abstract int setLocalVoicePitch(double pitch) Sets the voice pitch of the local speaker.- Parameters:
pitch- Voice frequency, in the range of 0.5 to 2.0. The default value is 1.0.- Returns:
- 0: Success.
- <0: Failure.
-
setLocalVoiceFormant
public abstract int setLocalVoiceFormant(double formantRatio) Sets the voice formant ratio for local speaker.- Parameters:
formantRatio- Voice frequency, in the range of -1.0 to 1.0. The default value is 0.0.- Returns:
- 0: Success.
- <0: Failure.
-
setLocalVoiceEqualization
public abstract int setLocalVoiceEqualization(Constants.AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, int bandGain) Sets the local voice equalization effect.- Parameters:
bandFrequency- The band frequency ranging from 0 to 9; representing the respective 10-band center frequencies of voice effects, including 31, 62, 125, 500, 1k, 2k, 4k, 8k, and 16k Hz.Constants#AUDIO_EQUALIZATION_BAND_FREQUENCYbandGain- Gain of each band in dB; ranging from -15 to 15.
-
setLocalVoiceReverb
Sets the local voice reverberation.- Parameters:
reverbKey- The reverberation key. This method contains five reverberation keys. For details, see the description of each value.value- Local voice reverberation value:AUDIO_REVERB_DRY_LEVEL(0)AUDIO_REVERB_WET_LEVEL(1)AUDIO_REVERB_ROOM_SIZE(2)AUDIO_REVERB_WET_DELAY(3)AUDIO_REVERB_STRENGTH(4)
-
setHeadphoneEQPreset
public abstract int setHeadphoneEQPreset(int preset) Sets preset audio playback effect for remote headphones after remote audio is mixed.- Parameters:
preset- The preset key: #HEADPHONE_EQUALIZER_PRESET. - HEADPHONE_EQUALIZER_OFF = 0x00000000 : Turn off the eualizer effect for headphones. - HEADPHONE_EQUALIZER_OVEREAR = 0x04000001 : For over-ear headphones only. - HEADPHONE_EQUALIZER_INEAR = 0x04000002 : For in-ear headphones only.- Returns:
- - 0: Success. - < 0: Failure. - -1(ERR_FAILED): A general error occurs (no specified reason).
-
setHeadphoneEQParameters
public abstract int setHeadphoneEQParameters(int lowGain, int highGain) Sets the parameters of audio playback effect for remote headphones after remote audio is mixed.- Parameters:
lowGain- The higher the parameter value, the deeper the sound. The value range is [-10,10].highGain- The higher the parameter value, the sharper the sound. The value range is [-10,10].- Returns:
- - 0: Success. - < 0: Failure. - -1(ERR_FAILED): A general error occurs (no specified reason).
-
setAudioEffectPreset
public abstract int setAudioEffectPreset(int preset) Sets an SDK preset audio effect.- Parameters:
preset- The options for SDK preset audio effects -AUDIO_EFFECT_OFF-ROOM_ACOUSTICS_KTV-ROOM_ACOUSTICS_VOCAL_CONCERT-ROOM_ACOUSTICS_STUDIO-ROOM_ACOUSTICS_PHONOGRAPH-ROOM_ACOUSTICS_VIRTUAL_STEREO-ROOM_ACOUSTICS_SPACIAL-ROOM_ACOUSTICS_ETHEREAL-ROOM_ACOUSTICS_3D_VOICE-ROOM_ACOUSTICS_CHORUS-VOICE_CHANGER_EFFECT_UNCLE-VOICE_CHANGER_EFFECT_OLDMAN-VOICE_CHANGER_EFFECT_BOY-VOICE_CHANGER_EFFECT_SISTER-VOICE_CHANGER_EFFECT_GIRL-VOICE_CHANGER_EFFECT_PIGKING-VOICE_CHANGER_EFFECT_HULK-STYLE_TRANSFORMATION_RNB-STYLE_TRANSFORMATION_POPULAR-PITCH_CORRECTION- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v3.2.0
Call this method to set an SDK preset audio effect for the local user who sends an audio
stream. This audio effect does not change the gender characteristics of the original voice.
After setting an audio effect, all users in the channel can hear the effect.
You can set different audio effects for different scenarios. See *Set the Voice Effect*.
To achieve better audio effect quality, Agora recommends calling
setAudioProfileand setting the `scenario` parameter to `AUDIO_SCENARIO_GAME_STREAMING(3)` before calling this method.
-
setVoiceBeautifierPreset
public abstract int setVoiceBeautifierPreset(int preset) Sets an SDK preset voice beautifier effect.- Parameters:
preset- The options for SDK preset voice beautifier effects: -VOICE_BEAUTIFIER_OFF-CHAT_BEAUTIFIER_MAGNETIC-CHAT_BEAUTIFIER_FRESH-CHAT_BEAUTIFIER_VITALITY-TIMBRE_TRANSFORMATION_VIGOROUS-TIMBRE_TRANSFORMATION_DEEP-TIMBRE_TRANSFORMATION_MELLOW-TIMBRE_TRANSFORMATION_FALSETTO-TIMBRE_TRANSFORMATION_FULL-TIMBRE_TRANSFORMATION_CLEAR-TIMBRE_TRANSFORMATION_RESOUNDING-TIMBRE_TRANSFORMATION_RINGING - {@link Constants#ULTRA_HIGH_QUALITY_VOICE ULTRA_HIGH_QUALITY_VOICE}- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v3.2.0
Call this method to set an SDK preset voice beautifier effect for the local user who sends an
audio stream. After setting a voice beautifier effect, all users in the channel can hear the
effect.
You can set different voice beautifier effects for different scenarios. See *Set the Voice
Effect*.
To achieve better audio effect quality, Agora recommends calling
setAudioProfileand 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.
-
setVoiceConversionPreset
public abstract int setVoiceConversionPreset(int preset) Sets an SDK preset voice conversion effect.- Parameters:
preset- The options for SDK preset voice conversion effects: -VOICE_CONVERSION_OFF-VOICE_CHANGER_NEUTRAL-VOICE_CHANGER_SWEET-VOICE_CHANGER_SOLID-VOICE_CHANGER_BASS-VOICE_CHANGER_CARTOON-VOICE_CHANGER_CHILDLIKE-VOICE_CHANGER_PHONE_OPERATOR-VOICE_CHANGER_MONSTER-VOICE_CHANGER_TRANSFORMERS-VOICE_CHANGER_GROOT-VOICE_CHANGER_DARTH_VADER-VOICE_CHANGER_IRON_LADY-VOICE_CHANGER_SHIN_CHAN-VOICE_CHANGER_GIRLISH_MAN-VOICE_CHANGER_CHIPMUNK- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v3.3.1
Call this method to set an SDK preset voice conversion effect for the local user who sends an
audio stream. After setting a voice conversion effect, all users in the channel can hear the
effect.
You can set different voice conversion effects for different scenarios. See *Set the Voice
Effect*.
To achieve better audio effect quality, Agora recommends calling
setAudioProfileand 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.
-
setAudioEffectParameters
public abstract int setAudioEffectParameters(int preset, int param1, int param2) Sets parameters for SDK preset audio effects.- Parameters:
preset- The options for SDK preset audio effects: - 3D voice effect: `ROOM_ACOUSTICS_3D_VOICE` - Call `setAudioProfile` and set the `profile` parameter to `AUDIO_PROFILE_MUSIC_STANDARD_STEREO(3)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before setting this enumerator; otherwise, the enumerator setting does not take effect. - If the 3D voice effect is enabled, users need to use stereo audio playback devices to hear the anticipated voice effect. - Pitch correction effect: `PITCH_CORRECTION`. To achieve better audio effect quality, Agora recommends calling `setAudioProfile` and setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before setting this enumerator.param1- - If you set `preset` to `ROOM_ACOUSTICS_3D_VOICE`, the `param1` sets the cycle period of the 3D voice effect. The value range is [1, 60] and the unit is a second. The default value is 10 seconds, indicating that the voice moves around you every 10 seconds. - If you set `preset` to `PITCH_CORRECTION`, `param1` sets the basic mode of the pitch correction effect: - `1`: (Default) Natural major scale. - `2`: Natural minor scale. - `3`: Japanese pentatonic scale.param2- - You need to set `param2` to `0`. - If you set `preset` to `PITCH_CORRECTION`, `param2` sets the tonic pitch of the pitch correction effect: - `1`: A - `2`: A# - `3`: B - `4`: (Default) C - `5`: C# - `6`: D - `7`: D# - `8`: E - `9`: F - `10`: F# - `11`: G - `12`: G#- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v3.2.0 Call this method to set the following parameters for the local user who sends an audio stream: - 3D voice effect: Sets the cycle period of the 3D voice effect. - Pitch correction effect: Sets the basic mode and tonic pitch of the pitch correction effect. Different songs have different modes and tonic pitches. Agora recommends bounding this method with interface elements to enable users to adjust the pitch correction interactively. After setting parameters, all users in the channel can hear the relevant effect.
-
setVoiceBeautifierParameters
public abstract int setVoiceBeautifierParameters(int preset, int param1, int param2) Sets parameters for SDK preset voice beautifier effects.- Parameters:
preset- The options for SDK preset voice beautifier effects: - `SINGING_BEAUTIFIER`: Singing beautifier effect.param1- The gender characteristics options for the singing voice: - `1`: A male-sounding voice. - `2`: A female-sounding voice.param2- The reverberation effects options: - `1`: The reverberation effect sounds like singing in a small room. - `2`: The reverberation effect sounds like singing in a large room. - `3`: The reverberation effect sounds like singing in a hall.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- 3.3.0.
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 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)`.
-
setVoiceConversionParameters
public abstract int setVoiceConversionParameters(int preset, int param1, int param2) Set parameters for SDK preset voice conversion.- Parameters:
preset- The options for SDK preset audio effects. See #VOICE_CONVERSION_PRESET.param1- reserved.param2- reserved.- Returns:
- - 0: Success. - < 0: Failure.
-
enableSoundPositionIndication
public abstract int enableSoundPositionIndication(boolean enabled) 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 \ref agora::rtc::IRtcEngine::setRemoteVoicePosition "setRemoteVoicePosition".- Parameters:
enabled- Sets whether or not to enable stereo panning for remote users: - true: enables stereo panning. - false: disables stereo panning.- Returns:
- - 0: Success. - < 0: Failure.
-
setRemoteVoicePosition
public abstract int setRemoteVoicePosition(int uid, double pan, double gain) 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.- Parameters:
uid- The ID of the remote user.pan- The sound position of the remote user. The value ranges from -1.0 to 1.0: - 0.0: the remote sound comes from the front. - -1.0: the remote sound comes from the left. - 1.0: the remote sound comes from the right.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.- Returns:
- - 0: Success. - < 0: Failure.
-
enableVoiceAITuner
Enables or disables the voice AI tuner.- Parameters:
enabled- Determines whether to enable the voice AI tuner: - true: Enable the voice AI tuner - false: (default) Disable the voice AI tuner.type- . The options for SDK voice AI tuner types. See #VOICE_AI_TUNER_TYPE.- Returns:
- - 0: Success. - < 0: Failure.
-
startAudioMixing
Starts playing and mixing the music file. This method mixes the specified local or online audio file with the audio stream from the microphone, or replaces the microphone’s audio stream with the specified local or remote audio file. You can choose whether the other user can hear the local audio playback and specify the number of playback loops. A successful `startAudioMixing` method call triggers theonAudioMixingStateChanged(AUDIO_MIXING_STATE_PLAYING) callback on the local client. When the audio mixing file playback finishes, the SDK triggers theonAudioMixingStateChanged(AUDIO_MIXING_STATE_STOPPED) callback on the local client.- Parameters:
filePath- Specifies the absolute path (including the suffixes of the filename) of the local or online audio file to be mixed. For example, `/sdcard/emulated/0/audio.mp4`. Supported audio formats: mp3, mp4, m4a, aac, 3gp, mkv, and wav. - If the path begins with /assets/, the audio file is in the /assets/ directory. - Otherwise, the audio file is in the absolute path.loopback- Sets which user can hear the audio mixing: - true: Only the local user can hear the audio mixing. - false: Both users can hear the audio mixing.cycle- Sets the number of playback loops: - Positive integer: Number of playback loops. - -1: Infinite playback loops.- Returns:
- - 0: Success.
- < 0: Failure.
-
WARN_AUDIO_MIXING_OPEN_ERROR (701): If the local audio file does not exist, or the online audio packet is not received within five seconds after it is opened, the SDK assumes that the media file cannot be used and returns this warning.
-
enableSpatialAudio
public abstract int enableSpatialAudio(boolean enabled) -
setRemoteUserSpatialAudioParams
-
setRemoteVideoSubscriptionOptions
-
setAINSMode
public abstract int setAINSMode(boolean enabled, int mode) Enables/Disables Agora AI Noise Suppression(AINS) with preset mode.- Parameters:
enabled- Sets whether or not to enable AINS. - true: Enables the AINS. - false: Disables the AINS.mode- The preset AINS mode, range is [0,1,2]: 0: AINS mode with soft suppression level. 1: AINS mode with aggressive suppression level. 2: AINS mode with aggressive suppression level and low algorithm latency.- Returns:
- - 0: Success. - < 0: Failure.
-
startAudioMixing
Starts playing and mixing the music file. This method mixes the specified local or online audio file with the audio stream from the microphone, or replaces the microphone’s audio stream with the specified local or remote audio file. You can choose whether the other user can hear the local audio playback and specify the number of playback loops. A successful `startAudioMixing` method call triggers theonAudioMixingStateChanged(AUDIO_MIXING_STATE_PLAYING) callback on the local client. When the audio mixing file playback finishes, the SDK triggers theonAudioMixingStateChanged(AUDIO_MIXING_STATE_STOPPED) callback on the local client.- Parameters:
filePath- Specifies the absolute path (including the suffixes of the filename) of the local or online audio file to be mixed. For example, `/sdcard/emulated/0/audio.mp4`. Supported audio formats: mp3, mp4, m4a, aac, 3gp, mkv, and wav. - If the path begins with /assets/, the audio file is in the /assets/ directory. - Otherwise, the audio file is in the absolute path.loopback- Sets which user can hear the audio mixing: - true: Only the local user can hear the audio mixing. - false: Both users can hear the audio mixing.cycle- Sets the number of playback loops: - Positive integer: Number of playback loops. - -1: Infinite playback loops.startPos- The playback position (ms) of the music file.- Returns:
- - 0: Success.
- < 0: Failure.
-
WARN_AUDIO_MIXING_OPEN_ERROR (701): If the local audio file does not exist, or the online audio packet is not received within five seconds after it is opened, the SDK assumes that the media file cannot be used and returns this warning.
-
stopAudioMixing
public abstract int stopAudioMixing()Stops playing or mixing the music file. Call this method when you are in a channel.- Returns:
- - 0: Success. - < 0: Failure.
-
pauseAudioMixing
public abstract int pauseAudioMixing()Pauses playing and mixing the music file. Call this method when you are in a channel.- Returns:
- - 0: Success. - < 0: Failure.
-
resumeAudioMixing
public abstract int resumeAudioMixing()Resumes playing and mixing the music file. Call this method when you are in a channel.- Returns:
- - 0: Success. - < 0: Failure.
-
adjustAudioMixingVolume
public abstract int adjustAudioMixingVolume(int volume) Adjusts the volume of audio mixing. Call this method when you are in a channel.- Parameters:
volume- Audio mixing volume. The value ranges between 0 and 100 (default).- Returns:
- - 0: Success. - < 0: Failure.
-
adjustAudioMixingPlayoutVolume
public abstract int adjustAudioMixingPlayoutVolume(int volume) Adjusts the audio mixing volume for local playback.- Parameters:
volume- Audio mixing volume for local playback. The value ranges between 0 and 100 (default).- Returns:
- - 0: Success. - < 0: Failure.
-
adjustAudioMixingPublishVolume
public abstract int adjustAudioMixingPublishVolume(int volume) Adjusts the audio mixing volume for publishing (for remote users).- Parameters:
volume- Audio mixing volume for publishing. The value ranges between 0 and 100 (default).- Returns:
- - 0: Success. - < 0: Failure.
-
getAudioMixingPlayoutVolume
public abstract int getAudioMixingPlayoutVolume()Retrieves the audio mixing volume for local playback. This method helps troubleshoot audio volume related issues.- Returns:
- - ≥ 0: The audio mixing volume, if this method call succeeds. The value range is [0,100]. - < 0: Failure.
-
getAudioMixingPublishVolume
public abstract int getAudioMixingPublishVolume()Retrieves the audio mixing volume for publishing. This method helps troubleshoot audio volume related issues.- Returns:
- - ≥ 0: The audio mixing volume for publishing, if this method call succeeds. The value range is [0,100]. - < 0: Failure.
-
getAudioMixingDuration
public abstract int getAudioMixingDuration()Gets the duration (ms) of the music file. Call this method when you are in a channel.- Returns:
- - Returns the audio mixing duration, if the method call is successful. - < 0: Failure.
-
getAudioMixingCurrentPosition
public abstract int getAudioMixingCurrentPosition()Gets the playback position (ms) of the music file. Call this method when you are in a channel.- Returns:
- - Returns the current playback position of the audio mixing, if the method call is successful. - < 0: Failure.
-
setAudioMixingPosition
public abstract int setAudioMixingPosition(int pos) Sets the playback position (ms) of the music file to a different starting position (the default plays from the beginning).- Parameters:
pos- The playback starting position (ms) of the audio mixing file.- Returns:
- - 0: Success. - < 0: Failure.
-
setAudioMixingDualMonoMode
In dual-channel music files, different audio data can be stored on the left and right channels. According to actual needs, you can set the channel mode as the original mode, the left channel mode, the right channel mode or the mixed mode- Parameters:
mode- The mode of channel mode- Returns:
- - 0: Success. - < 0: Failure.
-
setAudioMixingPitch
public abstract int setAudioMixingPitch(int pitch) Sets the pitch of the music file.- Parameters:
pitch- The pitch of the music file.- Returns:
- - 0: Success. - < 0: Failure.
-
setAudioMixingPlaybackSpeed
public abstract int setAudioMixingPlaybackSpeed(int speed) Sets the playback speed of the current music file.- Parameters:
speed- The playback speed. Agora recommends that you limit this value to between 50 and 400, defined as follows: - 50: Half the original speed. - 100: The original speed. - 400: 4 times the original speed.- Returns:
- - 0: Success. - < 0: Failure.
-
selectAudioTrack
public abstract int selectAudioTrack(int audioIndex) select the track of the mixing music file. Call this method after startAudioMixing is called.- Parameters:
audioIndex- Audio track index. The value begin from 0.- Returns:
- - 0: Success. - < 0: Failure.
-
getAudioTrackCount
public abstract int getAudioTrackCount()Get the audio track count of mixing music file. Call this method After startAudioMixing is called.- Returns:
- - >0: Success. - < 0: Failure.
-
getAudioEffectManager
Gets the IAudioEffectManager object associated with the current RTC engine.- Returns:
- IAudioEffectManager
-
startAudioRecording
Starts an audio recording.
The SDK allows recording during a call, which supports either one of the following formats:
- .wav: Large file size with high sound fidelity
- .aac: Small file size with low sound fidelity
Ensure that the directory to save the recording file exists and is writable. This method is usually called after the
joinChannelmethod. The recording automatically stops when theleaveChannelmethod is called.- Parameters:
filePath- Full file path of the recording file. The string of the file name is in UTF-8 code.quality- Audio recording quality:- Returns:
- 0: Success.
- <0: Failure.
-
startAudioRecording
public abstract int startAudioRecording(io.agora.rtc2.internal.AudioRecordingConfiguration config) Starts an audio recording.
The SDK allows recording during a call, which supports either one of the following formats:
- .wav: Large file size with high sound fidelity
- .aac: Small file size with low sound fidelity
Ensure that the directory to save the recording file exists and is writable. This method is usually called after the
joinChannelmethod. The recording automatically stops when theleaveChannelmethod is called.- Parameters:
config- audio file recording config- Returns:
- 0: Success.
- <0: Failure.
-
stopAudioRecording
public abstract int stopAudioRecording()Stops the audio recording on the client.
Note: Call this method before calling
leaveChannel, otherwise the recording automatically stops when theleaveChannelmethod is called.- Returns:
- 0: Success.
- <0: Failure.
-
startEchoTest
Starts a video call test.- Parameters:
config- The configuration of the echo test.- Returns:
- 0: Success.
- < 0: Failure.
-
stopEchoTest
public abstract int stopEchoTest()Stops an audio call test.- Returns:
- 0: Succeeded.
- <0: Failed.
ERR_REFUSED(-5). Failed to stop the echo test. The echo test may not be running.
-
startLastmileProbeTest
public abstract int startLastmileProbeTest(io.agora.rtc2.internal.LastmileProbeConfig config) Starts the last-mile network probe test before joining a channel to get the uplink and downlink last-mile network statistics, including the bandwidth, packet loss, jitter, and round-trip time (RTT). Once this method is enabled, the SDK triggers theonLastmileProbeResultcallback within 30 seconds, and reports the real-time statistics of the network conditions. Call this method to check the uplink network quality before users join a channel or before an audience switches to a host.- Parameters:
config- The configurations of the last-mile network probe test. For details, seeLastmileProbeConfig.- Returns:
- - 0: Success. - < 0: Failure.
-
stopLastmileProbeTest
public abstract int stopLastmileProbeTest()Stops the last-mile network probe test.- Returns:
- - 0: Success. - < 0: Failure.
-
setExternalAudioSource
@Deprecated public abstract int setExternalAudioSource(boolean enabled, int sampleRate, int channels) Deprecated.This method is deprecated. Use createCustomAudioTrack(Constants.AudioTrackType trackType, AudioTrackConfig config) instead.Sets the external audio source.- Parameters:
enabled- Determines whether to enable the external audio source: - true: Enable the external audio source. - false: (default) Disable 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: - 1: Mono. - 2: Stereo.- Returns:
- - 0: Success. - < 0: Failure.
-
setExternalAudioSink
public abstract int setExternalAudioSink(boolean enabled, int sampleRate, int channels) Sets the external audio sink.- Parameters:
enabled- Sets whether or not to the external audio sink. - true: Enables the external audio sink. - false: Disables the external audio sink.sampleRate- The sample rate (Hz) of the external audio sink. You can set this parameter as 16000, 32000, 44100, or 48000.channels- The number of audio channels of the external audio sink: - 1: Mono. - 2: Stereo.- Returns:
- - 0: Success. - < 0: Failure.
-
setExternalRemoteEglContext
Set remote eglContext. When engine destroy, the SDK will automatically release the eglContext internally.- Parameters:
eglContext- .- Returns:
- - 0: Success. - < 0: Failure.
-
pullPlaybackAudioFrame
public abstract int pullPlaybackAudioFrame(byte[] data, int lengthInByte) Pulls the remote audio frame. Before calling this method, call thesetExternalAudioSink(bool, int, int)method to enable and set the external audio sink. Ensure that you call this method after joining a channel. After a successful method call, the app pulls the decoded and mixed audio data for playback.- Parameters:
data- The audio data that you want to pull. The data format is in byte[].lengthInByte- The data length (byte) of the external audio data. The value of this parameter is related to the audio duration, and the values of the `sampleRate` and `channels` parameters that you set insetExternalAudioSink. Agora recommends setting the audio duration no shorter than 10 ms. The formula for `lengthInByte` is:
lengthInByte = sampleRate/1000 × 2 × channels × audio duration (ms).- Returns:
- - 0: Success. - < 0: Failure.
-
pullPlaybackAudioFrame
Pulls the remote audio frame. Before calling this method, call thesetExternalAudioSink(enabled: true) method to enable and set the external audio sink. Ensure that you call this method after joining a channel. After a successful method call, the app pulls the decoded and mixed audio data for playback.- Parameters:
data- The audio data that you want to pull. The data format is in ByteBuffer.lengthInByte- The data length (byte) of the external audio data. The value of this parameter is related to the audio duration, and the values of the `sampleRate` and `channels` parameters that you set insetExternalAudioSink. Agora recommends setting the audio duration no shorter than 10 ms. The formula for `lengthInByte` is:
lengthInByte = sampleRate/1000 × 2 × channels × audio duration (ms).- Returns:
- - 0: Success. - < 0: Failure.
-
startRecordingDeviceTest
public abstract int startRecordingDeviceTest(int indicationInterval) Starts the microphone test. This method tests whether the microphone works properly. Once the test starts, the SDK uses the IRtcEngineEventHandler::onAudioVolumeIndication() callback to notify the application on the volume information.- Parameters:
indicationInterval- The time interval (ms) between which the SDK triggers the \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication()" callback.- Returns:
- - 0: Success. - < 0: Failure.
-
stopRecordingDeviceTest
public abstract int stopRecordingDeviceTest()Stops the microphone test. This method stops the microphone test. To stop the test, call this method after calling the startRecordingDeviceTest() method.- Returns:
- - 0: Success. - < 0: Failure.
-
startPlaybackDeviceTest
Starts a playback device test. This method tests whether the playback device works properly with the specified playback audio file.- Parameters:
audioFileName- File path of the audio file for the test, which is in utf8 absolute path: - Supported File Format: wav, mp3, m4a, and aac - Supported File Sampling Rate: 8000, 16000, 32000, 44100, and 48000- Returns:
- * 0: Success. <0: Failure.
-
stopPlaybackDeviceTest
public abstract int stopPlaybackDeviceTest()Stops the playback device test. This method stops testing the playback device. You must call this method to stop the test after calling [startPlaybackDeviceTest](startPlaybackDeviceTest:).- Returns:
- * 0: Success. <0: Failure.
-
createCustomAudioTrack
public abstract int createCustomAudioTrack(Constants.AudioTrackType trackType, AudioTrackConfig config) Create a custom audio track and get the audio track id.- Parameters:
trackType- The type of custom audio track: -AUDIO_TRACK_MIXABLE(0): Mixable audio track -AUDIO_TRACK_DIRECT(1): direct audio trackconfig- The config of custom audio track: * @return - If the call is successful, SDK returns audio track id. - If the call fails, SDK returns 0xffffffff.
-
destroyCustomAudioTrack
public abstract int destroyCustomAudioTrack(int trackId) Destroy custom audio track by trackId- Parameters:
trackId- The custom audio track id- Returns:
- - 0: Success. - < 0: Failure.
-
setExternalAudioSource
@Deprecated public abstract int setExternalAudioSource(boolean enabled, int sampleRate, int channels, boolean localPlayback, boolean publish) Deprecated.This method is deprecated. Use createCustomAudioTrack(Constants.AudioTrackType trackType, AudioTrackConfig config) instead.Sets the external audio source.- Parameters:
enabled- Determines whether to enable the external audio source: - true: Enable the external audio source. - false: (default) Disable 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: - 1: Mono. - 2: Stereo.localPlayback- Enable/Disables the local playback of external audio track: - true: Enable local playback - false: Do not enable local playbackpublish- Determines whether to publish the external audio track: - true: Publish the external audio track. - false: Don`t publish the external audio track.- Returns:
- - 0: Success. - < 0: Failure.
-
pushExternalAudioFrame
Deprecated.This method is deprecated. Use pushExternalAudioFrame(byte[] data, long timestamp, int sampleRate, int channels, Constants.BytesPerSample bytesPerSample, int trackId) instead.Pushes the external audio data to the app.- Parameters:
data- The audio buffer data.timestamp- The timestamp of the audio data.- Returns:
- - 0: Success. - < 0: Failure.
-
pushExternalAudioFrame
@Deprecated public abstract int pushExternalAudioFrame(ByteBuffer data, long timestamp, int trackId) Deprecated.This method is deprecated. Use pushExternalAudioFrame(ByteBuffer[] data, long timestamp, int sampleRate, int channels, Constants.BytesPerSample bytesPerSample, int trackId) instead.Pushes the external audio data to the app.- Parameters:
data- The audio buffer data.timestamp- The timestamp of the audio data.trackId- The audio track ID.- Returns:
- - 0: Success. - < 0: Failure.
-
pushExternalAudioFrame
public abstract int pushExternalAudioFrame(byte[] data, long timestamp, int sampleRate, int channels, Constants.BytesPerSample bytesPerSample, int trackId) Pushes the external audio data to the app.- Parameters:
data- The audio buffer data.timestamp- The timestamp of the audio data.sampleRate- Sets the sample rate, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.channel- Sets the number of audio channels - 1: Mono. - 2: Stereo.bytesPerSample- bytes per sampletrackId- The audio track ID.- Returns:
- - 0: Success. - < 0: Failure.
-
pushExternalAudioFrame
public abstract int pushExternalAudioFrame(ByteBuffer data, long timestamp, int sampleRate, int channels, Constants.BytesPerSample bytesPerSample, int trackId) Pushes the external audio data to the app.- Parameters:
data- The audio buffer data.timestamp- The timestamp of the audio data.sampleRate- Sets the sample rate, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.channel- Sets the number of audio channels - 1: Mono. - 2: Stereo.bytesPerSample- bytes per sampletrackId- The audio track ID.- Returns:
- - 0: Success. - < 0: Failure.
-
setExternalVideoSource
public abstract int setExternalVideoSource(boolean enable, boolean useTexture, Constants.ExternalVideoSourceType sourceType) Sets the external video source. Once the external video source is enabled, the SDK prepares to accept the external video frame.- Parameters:
enable- Determines whether to enable the external video source. - true: Enable the external video source. Once set, the SDK creates the external source and prepares video data from `pushExternalVideoFrame` or `pushExternalEncodedVideoImage`. - false: Disable the external video source.useTexture- Determines whether to use textured video data. - true: Use texture, which is not supported now. - False: Do not use texture.sourceType- Determines whether the external video source is encoded. -VIDEO_FRAME(0): The external video source is not encoded. -ENCODED_VIDEO_FRAME(1): The external video source is encoded.- Returns:
- - 0: Success. - < 0: Failure.
-
setExternalVideoSource
public abstract int setExternalVideoSource(boolean enable, boolean useTexture, Constants.ExternalVideoSourceType sourceType, EncodedVideoTrackOptions encodedOpt) Sets the external video source. Once the external video source is enabled, the SDK prepares to accept the external video frame.- Parameters:
enable- Determines whether to enable the external video source. - true: Enable the external video source. Once set, the SDK creates the external source and prepares video data from `pushExternalVideoFrame` or `pushExternalEncodedVideoFrame`. - false: Disable the external video source.useTexture- Determines whether to use textured video data. - true: Use texture, which is not supported now. - False: Do not use texture.sourceType- Determines whether the external video source is encoded. -VIDEO_FRAME(0): The external video source is not encoded. -ENCODED_VIDEO_FRAME(1): The external video source is encoded.encodedOpt- Determine encoded video track options including codec type, cc mode and target bitrate.- Returns:
- - 0: Success. - < 0: Failure.
-
pushExternalVideoFrame
Deprecated.This method is deprecated. Call thesetExternalVideoSourcemethod and set `pushMode` as `true` before calling this method. Otherwise, a failure returns after calling this method.Pushes the video frame using the `VideoFrame` class and passes the video frame to the Agora SDK.- Parameters:
frame- Video frame to be pushed. SeeVideoFrame: - `buffer`: *Buffer* The buffer of the video frame. - `rotation`: *int* Rotation of the video frame in degrees. - `timestampNs`: *long* Timestamp of the video frame in nanoseconds.- Returns:
- - `true`: The frame is pushed successfully. - `false`: Failed to push the frame.
-
pushExternalVideoFrameById
public abstract int pushExternalVideoFrameById(VideoFrame frame, int videoTrackId) Pushes the external video frame to the app.- Parameters:
frame- The external video frame:VideoFrame.videoTrackId- The id of the video track.- Returns:
- - 0: Success. - < 0: Failure.
-
pushExternalEncodedVideoFrame
@Deprecated public abstract int pushExternalEncodedVideoFrame(ByteBuffer data, EncodedVideoFrameInfo frameInfo) Deprecated.This method is deprecated.Pushes the encoded external video frame to Agora SDK.- Parameters:
data- The encoded external video data, which must be the direct buffer.frameInfo- The encoded external video frame info:EncodedVideoFrameInfo.- Returns:
- - 0: Success, which means that the encoded external video frame is pushed successfully. - < 0: Failure, which means that the encoded external video frame fails to be pushed.
-
pushExternalEncodedVideoFrameById
public abstract int pushExternalEncodedVideoFrameById(ByteBuffer data, EncodedVideoFrameInfo frameInfo, int videoTrackId) Pushes the encoded external video frame to the app with specified connection.- Parameters:
data- The encoded external video data, which must be the direct buffer.frameInfo- The encoded external video frame info:EncodedVideoFrameInfo.videoTrackId- The id of the video track.- Returns:
- - 0: Success, which means that the encoded external video frame is pushed successfully. - < 0: Failure, which means that the encoded external video frame fails to be pushed.
-
isTextureEncodeSupported
public abstract boolean isTextureEncodeSupported()Checks whether texture encoding is supported.- Returns:
- True/False.
-
registerAudioFrameObserver
Registers an audio frame observer object.- Parameters:
observer- The IAudioFrameObserver interface, null means unregistering observer instead.- Returns:
- - 0: Success. - < 0: Failure.
-
registerAudioEncodedFrameObserver
public abstract int registerAudioEncodedFrameObserver(io.agora.rtc2.internal.AudioEncodedFrameObserverConfig config, IAudioEncodedFrameObserver observer) Registers an encoded audio frame observer object.- Parameters:
observer- The IAudioEncodedFrameObserver interface, null means unregistering observer instead.- Returns:
- - 0: Success. - < 0: Failure.
-
setRecordingAudioFrameParameters
public abstract int setRecordingAudioFrameParameters(int sampleRate, int channel, int mode, int samplesPerCall) Sets the audio recording format for theonRecordAudioFramecallback.- Parameters:
sampleRate- Sets the sample rate (`samplesPerSec`) returned in the `onRecordAudioFrame` callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.channel- Sets the number of audio channels (channels) returned in the `onRecordAudioFrame` callback: - 1: Mono. - 2: Stereo.mode- Sets the use mode of the onRecordAudioFrame callback: - `RAW_AUDIO_FRAME_OP_MODE_READ_ONLY(0)`: Read-only mode: Users only read the audio data without modifying anything. For example, when users acquire the data with the Agora SDK then push the RTMP streams. - `RAW_AUDIO_FRAME_OP_MODE_READ_WRITE(2)`: Read and write mode: Users read the data from AudioFrame, modify it, and then play it. For example, when users have their own sound-effect processing module and perform some voice pre-processing, such as a voice change.samplesPerCall- Sets the number of samples the `onRecordAudioFrame` callback returns. In RTMP streaming scenarios, set it as 1024.- Returns:
- - 0: Success. - < 0: Failure.
-
setPlaybackAudioFrameParameters
public abstract int setPlaybackAudioFrameParameters(int sampleRate, int channel, int mode, int samplesPerCall) Sets the audio recording format for theonPlaybackAudioFramecallback.- Parameters:
sampleRate- Sets the sample rate (`samplesPerSec`) returned in the `onPlaybackAudioFrame` callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.channel- Sets the number of audio channels (channels) returned in the `onPlaybackAudioFrame` callback: - 1: Mono. - 2: Stereo.mode- Sets the use mode of the onPlaybackAudioFrame callback: - `RAW_AUDIO_FRAME_OP_MODE_READ_ONLY(0)`: Read-only mode: Users only read the audio data without modifying anything. For example, when users acquire the data with the Agora SDK then push the RTMP streams. - `RAW_AUDIO_FRAME_OP_MODE_READ_WRITE(2)`: Read and write mode: Users read the data from AudioFrame, modify it, and then play it. For example, when users have their own sound-effect processing module and perform some voice pre-processing, such as a voice change.samplesPerCall- Sets the number of samples the `onPlaybackAudioFrame` callback returns. In RTMP streaming scenarios, set it as 1024.- Returns:
- - 0: Success. - < 0: Failure.
-
setMixedAudioFrameParameters
public abstract int setMixedAudioFrameParameters(int sampleRate, int channel, int samplesPerCall) Sets the mixed audio format for theonMixedAudioFramecallback.- Parameters:
sampleRate- Sets the sample rate (`samplesPerSec`) returned in the `onMixedAudioFrame` callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.channel- Sets the number of audio channels (channels) returned in the `onPlaybackAudioFrame` callback: - 1: Mono. - 2: Stereo.samplesPerCall- Sets the number of samples the `onMixedAudioFrame` callback returns. In RTMP streaming scenarios, set it as 1024.- Returns:
- - 0: Success. - < 0: Failure.
-
setEarMonitoringAudioFrameParameters
public abstract int setEarMonitoringAudioFrameParameters(int sampleRate, int channel, int mode, int samplesPerCall) Sets the audio ear monitoring format for theonEarMonitoringAudioFramecallback.- Parameters:
sampleRate- Sets the sample rate (`samplesPerSec`) returned in the `onEarMonitoringAudioFrame` callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.channel- Sets the number of audio channels (channels) returned in the `onEarMonitoringAudioFrame` callback: - 1: Mono. - 2: Stereo.mode- Sets the use mode of the onEarMonitoringAudioFrame callback: - `RAW_AUDIO_FRAME_OP_MODE_READ_ONLY(0)`: Read-only mode: Users only read the audio data without modifying anything. For example, when users acquire the data with the Agora SDK then push the RTMP streams. - `RAW_AUDIO_FRAME_OP_MODE_WRITE_ONLY(1)`: Write-only mode: Users replace the audio data with their own data and pass the data to the SDK for encoding. For example, when users acquire the data. - `RAW_AUDIO_FRAME_OP_MODE_READ_WRITE(2)`: Read and write mode: Users read the data from AudioFrame, modify it, and then play it. For example, when users have their own sound-effect processing module and perform some voice pre-processing, such as a voice change.samplesPerCall- Sets the number of samples the `onEarMonitoringAudioFrame` callback returns. In RTMP streaming scenarios, set it as 1024.- Returns:
- - 0: Success. - < 0: Failure.
-
addVideoWatermark
Deprecated.From v2.9.1. We recommend using theaddVideoWatermark2 method instead. This method adds a PNG watermark image to the local video stream for the sampling device, channel audience, or CDN live audience to see and capture. To add the PNG file to a CDN live publishing stream, see thesetLiveTranscodingmethod.Adds a watermark image to the local video.- Parameters:
watermark- Watermark image to be added to the local video stream. SeeAgora Image.- Returns:
- - 0: Success. - < 0: Failure.
-
addVideoWatermark
Deprecated.From v4.6.0. We recommend using theaddVideoWatermark2 method instead. This method adds a PNG watermark image to the local video stream in a live streaming. Once the watermark image is added, all the audience in the channel (CDN audience included), and the sampling 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 thesetVideoEncoderConfigurationmethod: - If the orientation mode of the encoding video is ORIENTATION_MODE_FIXED_LANDSCAPE, or the landscape mode in ORIENTATION_MODE_ADAPTIVE, the watermark uses the landscape orientation. - If the orientation mode of the encoding video is ORIENTATION_MODE_FIXED_PORTRAIT, or the portrait mode in ORIENTATION_MODE_ADAPTIVE, the watermark uses the portrait orientation. - When setting the watermark position, the region must be less than the dimensions set in the setVideoEncoderConfiguration method. Otherwise, the watermark image will be cropped.Adds a watermark image to the local video.- Parameters:
watermarkUrl- The local file path of the watermark image to be added. This method supports adding a watermark image from either the local file path or the assets file path. If you use the assets file path, you need to start with `/assets/` when filling in this parameter.options- The options of the watermark image to be added. SeeWatermark Options.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v2.9.1 to replace
addVideoWatermark1.
-
addVideoWatermark
- Parameters:
config- The watermark configuration. SeeWatermarkConfig.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v4.6.0
-
removeVideoWatermark
- Parameters:
id- The ID of the watermark image to be removed.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v4.6.0
-
clearVideoWatermarks
public abstract int clearVideoWatermarks()Removes the watermark image from the video stream added byaddVideoWatermark.- Returns:
- - 0: Success. - < 0: Failure.
-
setRemoteUserPriority
public abstract int setRemoteUserPriority(int uid, int userPriority) Sets the priority of a remote user's media stream.- Parameters:
uid- The ID of the remote user.userPriority- The priority of the remote user:USER_PRIORITY_HIGH(50): the user's priority is high.USER_PRIORITY_NORANL(100): (default) the user's priority is normal.
- Returns:
- 0: Success.
- <0: Failure.
- Since:
- v2.4.0.
Use this method with the
setRemoteSubscribeFallbackOptionmethod. If the fallback function is enabled for a subscribed stream, the SDK ensures the high-priority user gets the best possible stream quality.
-
setRemoteSubscribeFallbackOption
Sets the fallback option for the remotely subscribed video stream based on the network conditions. If @p option is set asSTREAM_FALLBACK_OPTION_AUDIO_ONLY(2), the SDK automatically switches the video from a high-stream to a low-stream, or disables the video when the downlink network condition cannot support both audio and video to guarantee the quality of the audio. The SDK monitors the network quality and restores the video stream when the network conditions improve. When the remotely subscribed video stream falls back to audio only, or the audio-only stream switches back to the video, the SDK triggers theonRemoteSubscribeFallbackToAudioOnlycallback. Ensure that you call this method before joining a channel.- Parameters:
option- The fallback option for the remotely subscribed video stream: -STREAM_FALLBACK_OPTION_DISABLED(0): No fallback behavior for the remotely subscribed video stream when the downlink network condition is poor. The quality of the video stream is not guaranteed. -STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW(1): (Default) The remotely subscribed video stream falls back to the low-stream video when the downlink network condition worsens. This option works only for this method. -STREAM_FALLBACK_OPTION_AUDIO_ONLY(2): Under poor downlink network conditions, the remotely subscribed video stream first falls back to the low-stream video; and then to an audio-only stream if the network condition worsens.- Returns:
- - 0: Success. - < 0: Failure.
-
setRemoteSubscribeFallbackOption
Deprecated. -
setHighPriorityUserList
public abstract int setHighPriorityUserList(int[] uidList, int option) Sets the high priority user list and related fallback option for the remotely subscribed video stream based on the network conditions in NASA2.- Parameters:
uidList- The id list of high priority users.option- The remote subscribe fallback option of high priority users.- Returns:
- - 0: Success. - < 0: Failure.
-
enableDualStreamMode
Deprecated.v4.2.0. This method is deprecated. Use setDualStreamMode instead. 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 usingsetRemoteVideoStreamType.Enables or disables the dual video stream mode.- Parameters:
enabled- - true: Enable the dual-stream mode. - false: (default) Disable the dual-stream mode.
-
enableDualStreamMode
@Deprecated public abstract int enableDualStreamMode(boolean enabled, SimulcastStreamConfig streamConfig) Deprecated.v4.2.0. This method is deprecated. Use setDualStreamMode instead. 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 usingsetRemoteVideoStreamType.Enables or disables the dual video stream mode.- Parameters:
enabled- - true: Enable the dual-stream mode. - false: (default) Disable the dual-stream mode.streamConfig- - The minor stream config
-
setDualStreamMode
Enables, disables or auto enable 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 usingsetRemoteVideoStreamType.- Parameters:
mode- - The dual-stream mode
-
setDualStreamMode
public abstract int setDualStreamMode(Constants.SimulcastStreamMode mode, SimulcastStreamConfig streamConfig) Enables, disables or auto enable 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 usingsetRemoteVideoStreamType.- Parameters:
mode- - The dual-stream modestreamConfig- - The minor stream config
-
setSimulcastConfig
Sets the multi-layer video stream configuration. When users expect the same UID to send multiple streams of different resolutions, they can achieve this by calling setSimulcastConfig If multi-layer is configured, the subscriber can choose to receive the corresponding layer of video stream usingsetRemoteVideoStreamType.- Parameters:
simulcastConfig- - The configuration for multi-layer video stream. It includes seven layers, ranging from STREAM_LAYER_1 to STREAM_LOW. A maximum of 3 layers can be enabled simultaneously.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v4.6.0
-
setLocalRenderTargetFps
Sets the target frames per second (FPS) for the local render target.- Parameters:
sourceType- The type of video source.targetFps- The target frames per second to be set for the local render target.- Returns:
- - 0: Success. - < 0: Failure.
-
setRemoteRenderTargetFps
public abstract int setRemoteRenderTargetFps(int targetFps) Sets the target frames per second (FPS) for the remote render target.- Parameters:
targetFps- The target frames per second to be set for the remote render target.- Returns:
- - 0: Success. - < 0: Failure.
-
setRemoteVideoStreamType
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.- Parameters:
uid- ID of the remote user sending the video stream.streamType- Sets the video stream type: - 0: High-stream video. - 1: Low-stream video.- Returns:
- - 0: Success. - < 0: Failure.
-
setRemoteVideoStreamType
Deprecated. -
setRemoteDefaultVideoStreamType
Sets the default stream type of the remote video if the remote user has enabled dual-stream.- Parameters:
streamType- Sets the default video stream type: - 0: High-stream video. - 1: Low-stream video.- Returns:
- - 0: Success. - < 0: Failure.
-
setRemoteDefaultVideoStreamType
Deprecated. -
setSubscribeAudioBlocklist
public abstract int setSubscribeAudioBlocklist(int[] uidList) Sets the blocklist of subscribe remote stream audio.- Parameters:
uidList- The id list of users who do not subscribe to audio.- Returns:
- - 0: Success. - < 0: Failure.
-
setSubscribeAudioAllowlist
public abstract int setSubscribeAudioAllowlist(int[] uidList) Sets the allowlist of subscribe remote stream audio.- Parameters:
uidList- The id list of users who do subscribe to audio.- Returns:
- - 0: Success. - < 0: Failure.
-
setSubscribeVideoBlocklist
public abstract int setSubscribeVideoBlocklist(int[] uidList) Sets the blocklist of subscribe remote stream video.- Parameters:
uidList- The id list of users who do not subscribe to video.- Returns:
- - 0: Success. - < 0: Failure.
-
setSubscribeVideoAllowlist
public abstract int setSubscribeVideoAllowlist(int[] uidList) Sets the whitelist of subscribe remote stream video.- Parameters:
uidList- The id list of users who do subscribe to video.- Returns:
- - 0: Success. - < 0: Failure.
-
enableEncryption
public abstract int enableEncryption(boolean enabled, io.agora.rtc2.internal.EncryptionConfig config) Enables/Disables the built-in encryption. In scenarios requiring high security, Agora recommends calling `enableEncryption` 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.- Parameters:
enabled- Whether to enable the built-in encryption. - `true`: Enable the built-in encryption. - `false`: Disable the built-in encryption.config- Configurations of built-in encryption schemas. SeeEncryptionConfig.- Returns:
- - 0: Success. - < 0: Failure. - -2(ERR_INVALID_ARGUMENT): An invalid parameter is used. Set the parameter with a valid value. - -7(ERR_NOT_INITIALIZED: The SDK is not initialized. Initialize the IRtcEngine instance before calling this method. - -4(ERR_NOT_SUPPORTED): The encryption mode is incorrect or the SDK fails to load the external encryption library. Check the enumeration or reload the external encryption library.
-
startRtmpStreamWithoutTranscoding
Publishes the local stream without transcoding to a specified CDN live RTMP address. (CDN live only.) The SDK returns the result of this method call in the \ref IRtcEngineEventHandler::onStreamPublished "onStreamPublished" callback. The \ref agora::rtc::IRtcEngine::startRtmpStreamWithoutTranscoding "startRtmpStreamWithoutTranscoding" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onRtmpStreamingStateChanged "onRtmpStreamingStateChanged" callback on the local client to report the state of adding a local stream to the CDN.- Parameters:
url- The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes.- Returns:
- - 0: Success. - < 0: Failure. - #ERR_INVALID_ARGUMENT (2): The RTMP URL address is NULL or has a string length of 0. - #ERR_NOT_INITIALIZED (7): You have not initialized the RTC engine when publishing the stream. - #ERR_ALREADY_IN_USE (19): This streaming URL is already in use. Use a new streaming URL for CDN streaming.
-
startRtmpStreamWithTranscoding
Publishes the local stream with transcoding to a specified CDN live RTMP address. (CDN live only.) The SDK returns the result of this method call in the \ref IRtcEngineEventHandler::onStreamPublished "onStreamPublished" callback. The \ref agora::rtc::IRtcEngine::startRtmpStreamWithTranscoding "startRtmpStreamWithTranscoding" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onRtmpStreamingStateChanged "onRtmpStreamingStateChanged" callback on the local client to report the state of adding a local stream to the CDN.- Parameters:
url- The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes.transcodingEnabled- Sets whether transcoding is enabled/disabled: - true: Enable transcoding. To [transcode](https://docs.agora.io/en/Agora%20Platform/terms?platform=All%20Platforms#transcoding) the audio or video streams when publishing them to CDN live, often used for combining the audio and video streams of multiple hosts in CDN live. - false: Disable transcoding.- Returns:
- - 0: Success. - < 0: Failure. - #ERR_INVALID_ARGUMENT (2): The RTMP URL address is NULL or has a string length of 0. - #ERR_NOT_INITIALIZED (7): You have not initialized the RTC engine when publishing the stream. - #ERR_ALREADY_IN_USE (19): This streaming URL is already in use. Use a new streaming URL for CDN streaming.
-
updateRtmpTranscoding
Update the video layout and audio settings for CDN live. (CDN live only.)- Parameters:
transcoding- Sets the CDN live audio/video transcoding settings. See LiveTranscoding.- Returns:
- - 0: Success. - < 0: Failure.
-
stopRtmpStream
Stop an RTMP stream with transcoding or without transcoding from the CDN. (CDN live only.) This method removes the RTMP URL address (added by the \ref IRtcEngine::startRtmpStreamWithoutTranscoding "startRtmpStreamWithoutTranscoding" method or IRtcEngine::startRtmpStreamWithTranscoding "startRtmpStreamWithTranscoding" method) from a CDN live stream. The SDK returns the result of this method call in the \ref IRtcEngineEventHandler::onStreamUnpublished "onStreamUnpublished" callback. The \ref agora::rtc::IRtcEngine::stopRtmpStream "stopRtmpStream" method call triggers the \ref agora::rtc::IRtcEngineEventHandler::onRtmpStreamingStateChanged "onRtmpStreamingStateChanged" callback on the local client to report the state of removing an RTMP stream from the CDN.- Parameters:
url- The RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes.- Returns:
- - 0: Success. - < 0: Failure.
-
createDataStream
public abstract int createDataStream(boolean reliable, boolean ordered) Creates a data stream. You can call this method to create a data stream and improve the reliability and ordering of data transmission.- Parameters:
reliable- Sets whether the recipients are guaranteed to receive the data stream from the sender within five seconds: - true: The recipients receive the data stream from the sender within five seconds. If the recipient does not receive the data stream within five seconds, an error is reported to the application. - false: There is no guarantee that the recipients receive the data stream within five seconds and no error message is reported for any delay or missing data stream.ordered- Sets whether the recipients receive the data stream in the sent order: - true: The recipients receive the data stream in the sent order. - false: The recipients do not receive the data stream in the sent order.- Returns:
- - Returns the stream ID, if the method call is successful. - <0: Failure.
-
createDataStream
Creates a data stream. Each user can create up to five data streams during the lifecycle of the RtcEngine.- Parameters:
config- The config of data stream.- Returns:
- - Returns the stream ID, if the method call is successful.
- < 0: Failure. The error code is related to the integer displayed in
Error Codes. For example, if it returns -2, then it indicatesERR_INVALID_ARGUMENT(-2)inError Codes.
-
sendStreamMessage
public abstract int sendStreamMessage(int streamId, byte[] message) Sends a data stream. After calling {@link RtcEngine#createDataStream() 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: - Up to 60 packets can be sent per second in a channel with each packet having a maximum size of 1 KB. - Each client can send up to 30 KB of data per second. - Each user can have up to five data streams simultaneously. After the remote user receives the data stream within 5 seconds, the SDK triggers theonStreamMessagecallback on the remote client. After the remote user does not receive the data stream within 5 seconds, the SDK triggers theonStreamMessageErrorcallback.- Parameters:
streamId- ID of the sent data stream returned by thecreateDataStreammethod.message- Sent data.- Returns:
- - 0: Success. - < 0: Failure.
-
sendRdtMessage
public abstract int sendRdtMessage(int uid, int type, byte[] message) - Parameters:
uid- remote user id.type- Reliable Data Transmission tunnel message type.message- The sent data.- Returns:
- - 0: Success. - < 0: Failure.
-
sendMediaControlMessage
public abstract int sendMediaControlMessage(int uid, byte[] message) - Parameters:
uid- remote user id. In particular, if the uid is set to 0, it means broadcasting the message to the entire channel.message- The sent data, max 1024 Bytes.- Returns:
- - 0: Success. - < 0: Failure.
-
setVideoQualityParameters
public abstract int setVideoQualityParameters(boolean preferFrameRateOverImageQuality) Sets the video quality preferences.- Parameters:
preferFrameRateOverImageQuality- The video preference to be set:- True: Frame rate over image quality
- False: Image quality over frame rate (default)
- Returns:
- 0: Success.
- <0: Failure.
-
setLocalVideoMirrorMode
Deprecated.Sets the local video mirror mode. Use this method before calling thestartPreviewmethod, or the mirror mode does not take effect until you call the `startPreview` method again.- Parameters:
mode- Sets the local video mirror mode: - `VIDEO_MIRROR_MODE_AUTO(0)`: (Default) The mirror mode determined by the SDK. If you use the front camera, the SDK enables the mirror mode; if you use the rear camera, the SDK disables the mirror mode. - `VIDEO_MIRROR_MODE_ENABLED(1)`: Enable the mirror mode. - `VIDEO_MIRROR_MODE_DISABLED(2)`: Disable the mirror mode.- Returns:
- - 0: Success. - < 0: Failure.
-
getRecommendedEncoderType
Deprecated.This method is deprecated.Gets the recommended encoder type.- Returns:
- The encoder type:
HARDWARE ENCODER(1): The hardware encoder.SOFTWARE ENCODER(2): The software encoder.
-
switchCamera
public abstract int switchCamera()Switches between front and rear cameras.- Returns:
- - 0: Success. - < 0: Failure.
-
switchCamera
Switches to appoint cameraId- Returns:
- - 0: Success. - < 0: Failure.
-
isCameraZoomSupported
public abstract boolean isCameraZoomSupported()Checks whether the camera zoom function is supported.- Returns:
- - true: The camera zoom function is supported. - false: The camera zoom function is not supported.
-
isCameraTorchSupported
public abstract boolean isCameraTorchSupported()Checks whether the camera flash function is supported.- Returns:
- - true: The camera flash function is supported. - false: The camera flash function is not supported.
-
isCameraFocusSupported
public abstract boolean isCameraFocusSupported()Checks whether the camera manual focus function is supported.- Returns:
- - true: The camera manual focus function is supported. - false: The camera manual focus function is not supported.
-
isCameraExposurePositionSupported
public abstract boolean isCameraExposurePositionSupported()Checks whether the camera exposure function is supported. Ensure that you call this method after the camera starts, for example, by calling `startPreview` or `joinChannel`.- Returns:
- true: The device supports the camera exposure function.
- false: The device does not support the camera exposure function.
- Since:
- v2.3.2.
-
isCameraAutoFocusFaceModeSupported
public abstract boolean isCameraAutoFocusFaceModeSupported()Checks whether the camera auto focus function is supported.- Returns:
- - true: The camera auto focus function is supported. - false: The camera auto focus function is not supported.
-
isCameraFaceDetectSupported
public abstract boolean isCameraFaceDetectSupported()Checks whether the camera face detect function is supported.- Returns:
- - true: The camera face detect is supported. - false: The camera face detect is not supported.
-
isCameraExposureSupported
public abstract boolean isCameraExposureSupported()Checks whether camera supports to set exposure value. Ensure that you call this method after the camera starts, for example, by calling `startPreview` or `joinChannel`.- Returns:
- - true: The device supports the camera exposure function.
- false: The device does not support the camera exposure function.
-
- Since:
- v4.2.2
setCameraZoomFactor
- Parameters:
factor- The camera zoom factor. It ranges from 1.0 to the maximum zoom supported by the camera.- Returns:
- - 0: Success. - < 0: Failure.
getCameraMaxZoomFactor
- Returns:
- The maximum zoom ratio supported by the camera.
setCameraFocusPositionInPreview
- Parameters:
positionX- The horizontal coordinate of the touch point in the view.positionY- The vertical coordinate of the touch point in the view.- Returns:
- - 0: Success. - < 0: Failure.
setCameraExposurePosition
onCameraExposureAreaChanged callback
on the local client.- Parameters:
positionXinView- The horizontal coordinate of the touch point in the view.positionYinView- The vertical coordinate of the touch point in the view.- Returns:
- 0: Success.
- < 0: Failure.
- Since:
- v2.3.2.
enableFaceDetection
- Parameters:
enabled- Determines whether to enable the camera face detect. - true: Enable the face detect. - false: Do not enable the face detect.
setCameraTorchOn
- Parameters:
isOn- Determines whether to enable the camera flash. - true: Enable the flash. - false: Do not enable the flash.
setCameraAutoFocusFaceModeEnabled
- Parameters:
enabled- Determines whether to enable the camera auto focus face mode. - true: Enable the auto focus face function. - false: Do not enable the auto focus face function.
setCameraExposureFactor
- Parameters:
factor- exposureFactor the recommended camera exposure factor ranging from -20 to 20 Absolute EV bias will set to camera.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v4.2.2
getCallId
- Returns:
- - The call ID if the method call is successful. - < 0: Failure.
rate
- Parameters:
callId- The call ID retrieved from thegetCallIdmethod.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.- Returns:
- - 0: Success. - < 0: Failure.
complain
- Parameters:
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.- Returns:
- - 0: Success. - < 0: Failure.
getSdkVersion
- Returns:
- The version of the current SDK in the string format.
getMediaEngineVersion
- Returns:
- The string of the version number in char format.
setLogFile
- Parameters:
filePath- File path of the log file. The string of the log file is in UTF-8.- Returns:
- - 0: Success. - < 0: Failure.
setLogFilter
- Parameters:
filter- Sets the log filter level: - `LOG_FILTER_DEBUG(0x80f)`: Output all API logs. Set your log filter as DEBUG if you want to get the most complete log file. - `LOG_FILTER_INFO(0x0f)`: Output logs of the CRITICAL, ERROR, WARNING, and INFO level. We recommend setting your log filter as this level. - `LOG_FILTER_WARNING(0x0e)`: Output logs of the CRITICAL, ERROR, and WARNING level. - `LOG_FILTER_ERROR(0x0c)`: Output logs of the CRITICAL and ERROR level. - `LOG_FILTER_CRITICAL(0x08)`: Output logs of the CRITICAL level. - `LOG_FILTER_OFF(0)`: Do not output any log.- Returns:
- - 0: Success. - < 0: Failure.
setLogLevel
- Parameters:
level- Sets the log level:LogLevel.- Returns:
- - 0: Success. - < 0: Failure.
setLogFileSize
- Parameters:
fileSizeInKBytes- The SDK log file size (KB).- Returns:
- - 0: Success. - < 0: Failure.
uploadLogFile
- Returns:
- - 0: Success. - < 0: Failure.
writeLog
- Parameters:
level- Sets the log level:LogLevel.- Returns:
- - 0: Success. - < 0: Failure.
getNativeHandle
Returns the native handler of the SDK Engine.
This interface is used to get native the C++ handler of the SDK engine that can be used in special scenarios, such as register the audio and video frame observer.
- Returns:
addHandler
- Parameters:
handler- The IRtcEngineEventHandler instance.
removeHandler
- Parameters:
handler- The IRtcEngineEventHandler object.
enableHighPerfWifiMode
- Parameters:
enable- Whether to enable/disable the Wi-Fi mode: - `true`: Enable the Wi-Fi mode. - `false`: Disable the Wi-Fi mode.- Returns:
- - 0: Success. - < 0: Failure.
getNativeMediaPlayer
Returns the native handler of the mediaplayer.
getErrorDescription
- Parameters:
error- The warning or error code.- Returns:
- The detailed warning or error description.
queryHDRCapability
- Returns:
- - 0: Unsupported. - 1: Supported. - < 0: Unknown.
- Since:
- v4.6.0
queryScreenCaptureCapability
- Returns:
- - 0: support 15 fps, this device does not support hardcoding. - 1: support 30 fps, Usually low - to mid-range devices. - 2: support 60 fps, Advanced devices. - < 0: Failure.
- Since:
- v4.2.0
monitorHeadsetEvent
- Parameters:
monitor- Whether to enable monitoring external headset device events. True/False.
monitorBluetoothHeadsetEvent
- Parameters:
monitor- Whether to enable monitoring Bluetooth headset device events. True/False.
setPreferHeadset
- Parameters:
enabled- Sets whether or not the default audio route is to the headset:- true: Set the default audio route to the headset.
- false: Do not set the default audio route to the headset.
setParameters
Provides technical preview functionalities or special customizations by configuring the SDK with JSON options.
The JSON options are not public by default. Agora is working on making commonly used JSON options public in a standard way.
- Parameters:
parameters- Parameter to be set as a JSON string in the specified format.- Returns:
- 0: Success.
- <0: Failure.
getParameters
- Parameters:
parameters- JSON string- Returns:
- A JSON string
getParameter
registerMediaMetadataObserver
getMaxMetadataSize callback.- Parameters:
observer- The IMetadataObserver class.type- The metadata type. Currently, the SDK supportsVIDEO_METADATA(0)only. -UNKNOWN_METADATA(-1): the metadata type is unknown. -VIDEO_METADATA(0): the metadata type is video.- Returns:
- - 0: Success. - < 0: Failure.
unregisterMediaMetadataObserver
- Parameters:
observer- The IMetadataObserver class.type- The metadata type. Currently, the SDK supportsVIDEO_METADATA(0)only.- Returns:
- - 0: Success. - < 0: Failure.
startOrUpdateChannelMediaRelay
onChannelMediaRelayStateChanged
callback, and this callback return the state of the media stream relay.
- If the `onChannelMediaRelayStateChanged` callback returns `RELAY_STATE_RUNNING(2)` and
`RELAY_OK(0)`, the SDK starts relaying media streams between the original and the destination
channel.
- If the `onChannelMediaRelayStateChanged` callback returns `RELAY_STATE_FAILURE(3)`, an
exception occurs during the media stream relay.- Parameters:
channelMediaRelayConfiguration- The configuration of the media stream relay. SeeChannelMediaRelayConfiguration.- Returns:
- - 0: Success. - < 0: Failure. - -1(ERR_FAILED): A general error occurs (no specified reason). - -2(ERR_INVALID_ARGUMENT): The argument is invalid. - -5(ERR_REFUSED): The request is rejected. - -8(ERR_INVALID_STATE): The current status is invalid, only allowed to be called when the role is the broadcaster.
- Since:
- v4.2.0
stopChannelMediaRelay
onChannelMediaRelayStateChanged
callback. If the callback returns `RELAY_STATE_IDLE(0)` and `RELAY_OK(0)`, the broadcaster
successfully stops the relay.- Returns:
- - 0: Success. - < 0: Failure. - -1(ERR_FAILED): A general error occurs (no specified reason). - -2(ERR_INVALID_ARGUMENT): The argument is invalid. - -5(ERR_REFUSED): The request is rejected. - -7(ERR_NOT_INITIALIZED): cross channel media streams are not relayed.
pauseAllChannelMediaRelay
- Returns:
- - 0: Success. - < 0: Failure. - -1(ERR_FAILED): A general error occurs (no specified reason). - -2(ERR_INVALID_ARGUMENT): The argument is invalid. - -5(ERR_REFUSED): The request is rejected. - -7(ERR_NOT_INITIALIZED): cross channel media streams are not relayed.
resumeAllChannelMediaRelay
- Returns:
- - 0: Success. - < 0: Failure. - -1(ERR_FAILED): A general error occurs (no specified reason). - -2(ERR_INVALID_ARGUMENT): The argument is invalid. - -5(ERR_REFUSED): The request is rejected. - -7(ERR_NOT_INITIALIZED): cross channel media streams are not relayed.
updateChannelMediaOptions
- Parameters:
options- The channel media options: ChannelMediaOptions.- Returns:
- - 0: Success. - < 0: Failure.
muteRecordingSignal
- Parameters:
muted- Determines whether to mute or resume the recording signal volume. - true: Mute the recording signal volume. - false: (Default) Resume the recording signal volume.- Returns:
- - 0: Success. - < 0: Failure.
setPlaybackAudioFrameBeforeMixingParameters
onPlaybackAudioFrameBeforeMixing callback.- Parameters:
sampleRate- Sets the sample rate (`samplesPerSec`) returned in the `onPlaybackAudioFrameBeforeMixing` callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.channel- Number of channels of the audio data returned in `onPlaybackAudioFrameBeforeMixing`, which can be set as 1 or 2: - 1: Mono - 2: Stereo- Returns:
- - 0: Success. - < 0: Failure.
setPlaybackAudioFrameBeforeMixingParameters
onPlaybackAudioFrameBeforeMixing callback.- Parameters:
sampleRate- Sets the sample rate (`samplesPerSec`) returned in the `onPlaybackAudioFrameBeforeMixing` callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.channel- Number of channels of the audio data returned in `onPlaybackAudioFrameBeforeMixing`, which can be set as 1 or 2: - 1: Mono - 2: StereosamplesPerCall- Sets the number of samples the `onMixedAudioFrame` callback returns. In RTMP streaming scenarios, set it as 1024.- Returns:
- - 0: Success. - < 0: Failure.
enableAudioSpectrumMonitor
- Parameters:
intervalInMS- Sets the time interval(ms) between two consecutive audio spectrum callback. The default value is 100. This param should be larger than 10.- Returns:
- - 0: Success. - < 0: Failure.
disableAudioSpectrumMonitor
- Returns:
- - 0: Success. - < 0: Failure.
registerAudioSpectrumObserver
- Parameters:
observer- A pointer to the audio spectrum observer: \ref agora::media::IAudioSpectrumObserver "IAudioSpectrumObserver".- Returns:
- - 0: Success. - < 0: Failure.
unRegisterAudioSpectrumObserver
- Parameters:
observer- The pointer to the audio spectrum observer: \ref agora::media::IAudioSpectrumObserver "IAudioSpectrumObserver".- Returns:
- - 0: Success. - < 0: Failure.
getEffectsVolume
- Returns:
- - Returns the volume of audio effects, if the method call is successful. The value ranges between 0.0 and 100.0 (original volume). - < 0: Failure.
setEffectsVolume
- Parameters:
volume- The volume of audio effects. The value ranges between 0.0 and 100.0 (default).- Returns:
- - 0: Success. - < 0: Failure.
preloadEffect
- Parameters:
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.- Returns:
- - 0: Success. - < 0: Failure.
preloadEffect
- Parameters:
soundId- The ID of the audio effect.filePath- The absolute path of the local audio effect file or the URLstartPos- The start position of the online audio effect file. Supported audio formats: mp3, mp4, m4a, aac, 3gp, mkv and wav.- Returns:
- - 0: Success. - < 0: Failure.
playEffect
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.- Parameters:
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: - `-1`: Play the audio effect in an indefinite loop until you callstopEffectorstopAllEffects. - `0`: Play the audio effect once. - `1`: Play the audio effect twice.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: - `-1.0`: The audio effect shows on the left. - `0.0`: The audio effect shows ahead. - `1.0`: The audio effect shows on the right.gain- The volume of the audio effect. The value ranges between 0.0 and 100.0. 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 specified audio effect to the remote stream: - True: Publish the audio effect to the remote. - False: false: Do not publish the audio effect to the remote.- Returns:
- - 0: Success. - < 0: Failure.
playEffect
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.- Parameters:
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: - `-1`: Play the audio effect in an indefinite loop until you callstopEffectorstopAllEffects. - `0`: Play the audio effect once. - `1`: Play the audio effect twice.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: - `-1.0`: The audio effect shows on the left. - `0.0`: The audio effect shows ahead. - `1.0`: The audio effect shows on the right.gain- The volume of the audio effect. The value ranges between 0.0 and 100.0. 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 specified audio effect to the remote stream: - True: Publish the audio effect to the remote. - False: false: Do not publish the audio effect to the remote.startPos- The start position- Returns:
- - 0: Success. - < 0: Failure.
playAllEffects
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.- Parameters:
loopCount- The number of times the audio effect loops: - `-1`: Play the audio effect in an indefinite loop until you callstopEffectorstopAllEffects. - `0`: Play the audio effect once. - `1`: Play the audio effect twice.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: - `-1.0`: The audio effect shows on the left. - `0.0`: The audio effect shows ahead. - `1.0`: The audio effect shows on the right.gain- The volume of the audio effect. The value ranges between 0.0 and 100.0. 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 specified audio effect to the remote stream: - True: Publish the audio effect to the remote. - False: Do not publish the audio effect to the remote.- Returns:
- - 0: Success. - < 0: Failure.
getVolumeOfEffect
- Parameters:
soundId- The ID of the audio effect.- Returns:
- - Returns the volume of the specified audio effect, if the method call is successful. The value ranges between 0.0 and 100.0 (original volume). - < 0: Failure.
setVolumeOfEffect
- Parameters:
soundId- The ID of the audio effect.volume- The volume of the specified audio effect. The value ranges between 0.0 and 100.0 (default).- Returns:
- - 0: Success. - < 0: Failure.
pauseEffect
- Parameters:
soundId- The ID of the audio effect.- Returns:
- - 0: Success. - < 0: Failure.
pauseAllEffects
- Returns:
- - 0: Success. - < 0: Failure.
resumeEffect
- Parameters:
soundId- The ID of the audio effect.- Returns:
- - 0: Success. - < 0: Failure.
resumeAllEffects
- Returns:
- - 0: Success. - < 0: Failure.
stopEffect
- Parameters:
soundId- The ID of the audio effect.- Returns:
- - 0: Success. - < 0: Failure.
stopAllEffects
- Returns:
- - 0: Success. - < 0: Failure.
unloadEffect
- Parameters:
soundId- The ID of the audio effect.- Returns:
- - 0: Success. - < 0: Failure.
unloadAllEffects
- Returns:
- - 0: Success. - < 0: Failure.
getEffectDuration
- Parameters:
filePath- The file path of a local file, including the filename extensions. Agora supports using a URI address, an absolute path, or a path that starts with /assets/. **Note**: You might encounter permission issues if you use an absolute path to access a local file, so Agora recommends using a URI address instead. For example: "content://com.android.providers.media.documents/document/audio%3A14441".- Returns:
- - ≥ 0: A successful method call. Returns the total duration (ms) of the specified audio effect file. - < 0: Failure.
setEffectPosition
- Parameters:
soundId- Audio effect ID. Ensure that this parameter is set to the same value as in `playEffect`.pos- The playback position (ms) of the audio effect file.- Returns:
- - 0: Success. - < 0: Failure.
getEffectCurrentPosition
- Parameters:
soundId- Audio effect ID. Ensure that this parameter is set to the same value as in `playEffect`.- Returns:
- - ≥ 0: A successful method call. Returns the playback position (ms) of the specified audio effect file. - < 0: Failure.
registerVideoEncodedFrameObserver
- Parameters:
receiver- The IVideoEncodedFrameObserver object:IVideoEncodedFrameObserver.- Returns:
- - 0: Success. - < 0: Failure.
registerFaceInfoObserver
- Parameters:
observer- A pointer to the face info observer object: IFaceInfoObserver.- Returns:
- - 0: Success. - < 0: Failure.
takeSnapshot
- Parameters:
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: - Windows: `C:\Users\\AppData\Local\Agora\ \example.jpg` - iOS: `/App Sandbox/Library/Caches/example.jpg` - macOS: `~/Library/Logs/example.jpg` - Android: `/storage/emulated/0/Android/data/ /files/example.jpg` Ensure that the path you specify exists and is writable. - Returns:
- - 0 : Success. - < 0 : Failure.
takeSnapshot
- Parameters:
uid- The user ID. Set uid as 0 if you want to take a snapshot of the local user's video.config- The configuration for the take snapshot. See SnapshotConfig. Ensure that the path you specify exists and is writable.- Returns:
- - 0 : Success. - < 0: Failure. - -4: Incorrect observation position. Modify the input observation position according to the reqiurements specified in SnapshotConfig.
enableContentInspect
loadExtensionProvider
registerExtension
- Parameters:
provider- The name of the extension provider, e.g. agora.io.extension- The name of the extension, e.g. agora.beauty.sourceType- The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. SeeConstants#MediaSourceType.- Returns:
- - 0: Success. - < 0: Failure.
enableExtension
- Parameters:
provider- The name of the extension provider, e.g. agora.io.extension- The name of the extension, e.g. agora.beauty.enable- Whether to enable the extension: - true: (Default) Enable the extension. - false: Disable the extension.- Returns:
- - 0: Success. - < 0: Failure.
enableExtension
- Parameters:
provider- The name of the extension provider, e.g. agora.io.extension- The name of the extension, e.g. agora.beauty.enable- Whether to enable the extension: - true: (Default) Enable the extension. - false: Disable the extension.sourceType- The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. SeeConstants#MediaSourceType.- Returns:
- - 0: Success. - < 0: Failure.
setExtensionProperty
- Parameters:
provider- The name of the extension provider, e.g. agora.io.extension- The name of the extension, e.g. agora.beauty.key- The key of the extension.value- The JSON formatted value of the extension key.- Returns:
- true, if get property success, otherwise false
setExtensionProperty
- Parameters:
provider- The name of the extension provider, e.g. agora.io.extension- The name of the extension, e.g. agora.beauty.key- The key of the extension.value- The JSON formatted value of the extension key.sourceType- The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. SeeConstants#MediaSourceType.- Returns:
- true, if get property success, otherwise false
getExtensionProperty
- Parameters:
provider- The name of the extension provider, e.g. agora.io.extension- The name of the extension, e.g. agora.beauty.key- The key of the extension.- Returns:
- JSON formatted string of property's value; return null if failed
getExtensionProperty
- Parameters:
provider- The name of the extension provider, e.g. agora.io.extension- The name of the extension, e.g. agora.beauty.key- The key of the extension.sourceType- The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. SeeConstants#MediaSourceType.- Returns:
- JSON formatted string of property's value; return null if failed
setExtensionProviderProperty
- Parameters:
provider- The name of the extension provider, e.g. agora.io.key- The key of the extension.value- The JSON formatted value of the extension key.- Returns:
- - 0: Success. - < 0: Failure.
enableExtension
- Parameters:
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. SeeExtensionInfo.enable- Whether to enable the extension: - true: (Default) Enable the extension. - false: Disable the extension.- Returns:
- - 0: Success. - < 0: Failure.
setExtensionProperty
- Parameters:
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. SeeExtensionInfo.key- The key of the extension.value- The JSON formatted value of the extension key.- Returns:
- - 0: Success. - < 0: Failure.
getExtensionProperty
- Parameters:
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. SeeExtensionInfo.key- The key of the extension.- Returns:
- JSON formatted string of property's value; return null if failed
startScreenCapture
- Parameters:
screenCaptureParameters- The configuration of the screen sharing. SeeScreenCaptureParameters.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v3.7.0
During screen sharing, make sure the user has granted screen capture permission to the
application and the Android API level is not earlier than 21; otherwise, the SDK reports error
codes
ERR_SCREEN_CAPTURE_PERMISSION_DENIED(16)andERR_SCREEN_CAPTURE_SYSTEM_NOT_SUPPORTED(2). To capture system audio during screen sharing, ensure that the Android API level is not earlier than 29 as well; otherwise, the SDK reports the error codeERR_SCREEN_CAPTURE_SYSTEM_AUDIO_NOT_SUPPORTED(3).
setExternalMediaProjection
- Parameters:
mediaProjection- MediaProjection is an Android class that provides access to screen capture and recording capabiliies.- Returns:
- - 0: Success. - < 0: Failure.
setScreenCaptureScenario
- Parameters:
screenScenario- The screen sharing scenario. See #ScreenScenarioType.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v4.2.0 When you start screen sharing, you can call this method to set the screen sharing scenario. The SDK adjusts the video quality and experience of the sharing according to the scenario.
stopScreenCapture
- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v3.7.0 After calling this method to stop screen sharing
setVideoScenario
- Parameters:
scenarioType- The video application scenario.- Returns:
- - 0: Success. - < 0: Failure.
setVideoQoEPreference
- Parameters:
qoePreference- he qoe preference type.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v4.2.1 You can call this method to set the expected QoE Preference. The SDK will optimize the video experience for each preference you set.
updateScreenCaptureParameters
- Parameters:
screenCaptureParameters- The configuration of the screen sharing. SeeScreenCaptureParameters. Note: This parameter is only available for scenarios where `captureVideo` is `true`.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v3.7.0
registerVideoFrameObserver
IVideoFrameObserver
class in this method, and register callbacks according to your scenarios.
After you successfully register the video frame observer, the SDK triggers the registered
callbacks each time a video frame is received.- Parameters:
observer- Video frame observer object instance. SeeIVideoFrameObserver.- Returns:
- - 0: Success. - < 0: Failure.
createMediaPlayer
- Returns:
IMediaPlayer
createMediaRecorder
- Parameters:
info- The RecorderStreamInfo object. It contains user ID and channel name of user.- Returns:
AgoraMediaRecorder
destroyMediaRecorder
getMediaRecorder to get the `AgoraMediaRecorder`
object.- Parameters:
mediaRecorder- The Object of \ref AgoraMediaRecorder.
getMediaPlayerCacheManager
- Returns:
IMediaPlayer
getH265Transcoder
- Returns:
IH265Transcoder
enableExternalAudioSourceLocalPlayback
- Returns:
- - 0: Success. - <0: Failure.
adjustCustomAudioPublishVolume
- Parameters:
trackId- The custom audio track id.volume- The volume, range is [0,100]: 0: mute, 100: The original volume- Returns:
- - 0: Success. - < 0: Failure.
adjustCustomAudioPlayoutVolume
- Parameters:
trackId- The custom audio track id.volume- The volume, range is [0,100]: 0: mute, 100: The original volume- Returns:
- - 0: Success. - < 0: Failure.
startRhythmPlayer
- Parameters:
sound1- The absolute path or URL address (including the filename extensions) of the file for the downbeat.sound2- The absolute path or URL address (including the filename extensions) of the file for the upbeats.- Returns:
- - 0: Success. - < 0: Failure.
stopRhythmPlayer
- Returns:
- - 0: Success. - < 0: Failure.
configRhythmPlayer
- Returns:
- - 0: Success. - < 0: Failure.
setDirectCdnStreamingAudioConfiguration
- Parameters:
profile- Sets the sample rate, bitrate, encoding mode, and the number of channels: #AUDIO_PROFILE_TYPE.- Returns:
- - 0: Success. - < 0: Failure.
setDirectCdnStreamingVideoConfiguration
- Parameters:
config- The local video encoder configuration: VideoEncoderConfiguration.- Returns:
- - 0: Success. - < 0: Failure.
getCurrentMonotonicTimeInMs
startDirectCdnStreaming
- Parameters:
eventHandler- A pointer to the direct cdn streaming event handler. "IDirectCdnStreamingEventHandler".publishUrl- The url of the cdn used to publish the stream.options- The direct cdn streaming media options: DirectCdnStreamingMediaOptions. This API must pass an audio-related option, and temporarily cannot pass more than one. For video-related options, you can either choose to not pass any, or only one.- Returns:
- - 0: Success. - < 0: Failure.
stopDirectCdnStreaming
- Returns:
- - 0: Success. - < 0: Failure.
updateDirectCdnStreamingMediaOptions
- Parameters:
options- The direct cdn streaming media options: DirectCdnStreamingMediaOptions.- Returns:
- - 0: Success. - < 0: Failure.
createCustomVideoTrack
- Returns:
- - > 0: the useable video track id. - < 0: Failure.
createCustomEncodedVideoTrack
- Returns:
- - > 0: the useable video track id. - < 0: Failure.
destroyCustomVideoTrack
- Parameters:
video_track_id- The video track id which was created by createCustomVideoTrack- Returns:
- - 0: Success. - < 0: Failure.
destroyCustomEncodedVideoTrack
- Parameters:
video_track_id- The video track id which was created by createCustomEncodedVideoTrack- Returns:
- - 0: Success. - < 0: Failure.
setCloudProxy
onConnectionStateChanged`(CONNECTION_STATE_CONNECTING,
CONNECTION_CHANGED_SETTING_PROXY_SERVER)` callback.
To disable the cloud proxy that has been set, call `setCloudProxy(NONE_PROXY)`. To change the
cloud proxy type that has been set, call `setCloudProxy(NONE_PROXY)` first, and then call
`setCloudProxy`, and pass the value that you expect in `proxyType`.- Parameters:
proxyType- The cloud proxy type. This parameter is required, and the SDK reports an error if you do not pass in a value. The cloud proxy types include: -TRANSPORT_TYPE_NONE_PROXY(0)-TRANSPORT_TYPE_UDP_PROXY(1)- Returns:
- - 0: Success. - < 0: Failure. - `-2(ERR_INVALID_ARGUMENT)`: The parameter is invalid. - `-7(ERR_NOT_INITIALIZED)`: The SDK is not initialized.
setLocalAccessPoint
- Parameters:
config- Configurations for local access point. For details, seeLocalAccessPointConfiguration
enableCustomAudioLocalPlayback
- Parameters:
trackId- custom audio track id.enabled- Enable/Disables the local playback of external audio track: - true: Enable local playback - false: (Default) Do not enable local playback- Returns:
- - 0: Success. - < 0: Failure.
setAdvancedAudioOptions
- Parameters:
options- advanced audio option.- Returns:
- - 0: Success. - < 0: Failure.
setAVSyncSource
- Parameters:
channelId- The channel iduid- The user ID of the remote user to be bound with (local user)- Returns:
- - 0: Success. - < 0: Failure.
enableVideoImageSource
- Parameters:
enabled- true for enable, false for disableoptions- options for image track
getNetworkType
- Returns:
- - 0: DISCONNECTED. - 1: LAN. - 2: WIFI. - 3: MOBILE_2G - 4: MOBILE_3G - 5: MOBILE_4G - 6: MOBILE_5G - -1: UNKNOWN
getNtpWallTimeInMs
startMediaRenderingTracing
- Returns:
- - 0: Success. - < 0: Failure. - -7(ERR_NOT_INITIALIZED): The SDK is not initialized. Initialize the `RtcEngine` instance before calling this method.
- Since:
- v4.1.1
enableInstantMediaRendering
- Returns:
- - 0: Success. - < 0: Failure. - -7(ERR_NOT_INITIALIZED): The SDK is not initialized. Initialize the `RtcEngine` instance before calling this method.
- Since:
- v4.1.1
setupAudioAttributes
- Parameters:
AudioAttributes-- Returns:
- - 0: 方法调用成功 - < 0: 方法调用失败
isFeatureAvailableOnDevice
- Parameters:
type- The feature type. -FEATURE_VIDEO_VIRTUAL_BACKGROUND(1)-FEATURE_VIDEO_BEAUTY_EFFECT(2)- Returns:
- - true: available. - false: not available.
- Since:
- v4.3.0
sendAudioMetadata
- Parameters:
metadata- Audio Metadata.- Returns:
- - 0: Success. - < 0: Failure.
- Since:
- v4.3.1