API Overview
Agora provides a flexible combination of APIs deployed globally to deliver reliable real-time audio and video communication.
Initialization
| API | Description |
|---|---|
| createAgoraRtcEngine | Creates an IRtcEngine object. |
| initialize | Initializes the IRtcEngine. |
| release | Releases the IRtcEngine instance. |
| RtcEngineReleaseCallback | Callback triggered when IRtcEngine is released. |
Channel Management
| API | Description |
|---|---|
| setChannelProfile | Sets the channel profile. |
| joinChannel [1/2] | Joins a channel. |
| joinChannel [2/2] | Joins a channel and sets media options. |
| joinChannelEx | Joins a channel. |
| updateChannelMediaOptions | Updates the media options of the channel after joining. |
| updateChannelMediaOptionsEx | Updates channel media options after joining a channel. |
| leaveChannel [1/2] | Leaves the channel. |
| leaveChannel [2/2] | Sets channel options and leaves the channel. |
| leaveChannelEx [1/2] | Leaves a channel. |
| leaveChannelEx [2/2] | Sets channel options and leaves the channel. |
| preloadChannel | Preloads the specified channel to reduce the time it takes for an audience member to join. |
| updatePreloadChannelToken | Updates the wildcard token used for preloaded channels. |
| renewToken | Updates the Token. |
| setClientRole [1/2] | Sets the user role. |
| setClientRole [2/2] | Sets the user role and audience latency level. |
| getUserInfoByUidEx | Retrieves user information by user ID. |
| getUserInfoByUserAccountEx | Retrieves user information by User Account. |
| joinChannelWithUserAccountEx | Joins a channel using a user account and token, and sets media options. |
| onClientRoleChanged | Callback triggered when the user role or audience latency level changes. |
| onClientRoleChangeFailed | Callback triggered when switching user roles fails. |
| onError | onError callback. Reports SDK runtime errors. |
| onJoinChannelSuccess | Callback when the local user successfully joins a channel. |
| onLeaveChannel | Callback triggered when a user leaves the channel. |
| onRejoinChannelSuccess | onRejoinChannelSuccess callback. |
| onRenewTokenResult | renewToken method call result callback. |
| onRequestToken | Callback triggered when the Token expires. |
| onRtcStats | Reports statistics of the current call. |
| onTokenPrivilegeWillExpire | Callback triggered when the Token will expire in 30 seconds. |
| onUserJoined | Callback triggered when a remote user or host joins the channel. |
| onUserOffline | onUserOffline callback: Triggered when a remote user (communication channel) or host (live broadcast channel) leaves the channel. |
Publish and Subscribe
| API | Description |
|---|---|
| muteAllRemoteAudioStreams | Stops or resumes receiving all remote audio streams. |
| muteAllRemoteAudioStreamsEx | Stops or resumes subscribing to all remote users' audio streams. |
| muteAllRemoteVideoStreams | Stops or resumes receiving all remote users' video streams. |
| muteAllRemoteVideoStreamsEx | Stops or resumes subscribing to all remote users' video streams. |
| muteLocalAudioStream | Controls whether to publish the locally captured audio stream. |
| muteLocalAudioStreamEx | Stops or resumes publishing the local audio stream. |
| muteLocalVideoStream | Controls whether to publish the captured local video stream. |
| muteLocalVideoStreamEx | Stops or resumes publishing the local video stream. |
| muteRemoteAudioStream | Stops or resumes subscribing to the audio stream of a specified remote user. |
| muteRemoteAudioStreamEx | Stops or resumes receiving audio stream from a specified user. |
| muteRemoteVideoStream | Stops or resumes subscribing to the video stream of a specified remote user. |
| muteRemoteVideoStreamEx | Stops or resumes receiving video stream from a specified remote user. |
| setDualStreamMode [1/2] | Sets the video stream mode on the sender side to control whether to send a low-quality stream. |
| setDualStreamMode [2/2] | Configures the video stream mode for different quality layers on the sender side. |
| setDualStreamModeEx | Sets the video stream mode with multiple quality levels on the sender side. |
| setRemoteDefaultVideoStreamType | Sets the default video stream type to subscribe to. |
| setRemoteVideoStreamType | Sets the type of video stream to subscribe to. |
| setRemoteVideoStreamTypeEx | Sets the type of video stream to subscribe to. |
| setRemoteVideoSubscriptionOptions | Sets subscription options for remote video streams. |
| setRemoteVideoSubscriptionOptionsEx | Sets whether to subscribe to a remote user's video stream. |
| setSubscribeAudioAllowlist | Sets the allowlist for audio stream subscription. |
| setSubscribeAudioAllowlistEx | Sets the allowlist for audio stream subscription. |
| setSubscribeAudioBlocklist | Sets the blocklist of users whose audio streams will not be subscribed to. |
| setSubscribeAudioBlocklistEx | Sets the blocklist of users whose audio streams are not subscribed. |
| setSubscribeVideoAllowlist | Sets the allowlist for video stream subscription. |
| setSubscribeVideoAllowlistEx | Sets the allowlist for video stream subscription. |
| setSubscribeVideoBlocklist | Sets the blocklist for video stream subscription. |
| setSubscribeVideoBlocklistEx | Sets the list of user IDs whose video streams you do not want to subscribe to. |
| onAudioPublishStateChanged | Callback triggered when the audio publishing state changes. |
| onAudioSubscribeStateChanged | Callback for audio subscription state changes. |
| onVideoSubscribeStateChanged | Callback for video subscription state changes. |
Audio Basic Features
| API | Description |
|---|---|
| adjustPlaybackSignalVolume | Adjusts the local playback volume of all remote users. |
| adjustUserPlaybackSignalVolume | Adjusts the playback signal volume of a specified remote user. |
| adjustUserPlaybackSignalVolumeEx | Adjusts the playback signal volume of a specified remote user. |
| disableAudio | Disables the audio module. |
| enableAudio | Enables the audio module. |
| enableAudioVolumeIndication | Enables the audio volume indication reporting. |
| enableAudioVolumeIndicationEx | Enables the reporting of user volume indications. |
| setAudioProfile [2/2] | Sets the audio profile. |
| setAudioScenario | Sets the audio scenario. |
| setAudioSessionOperationRestriction | Sets the SDK's permission to operate the audio session. |
| onActiveSpeaker | Callback for the most active remote speaker. |
| onAudioVolumeIndication | onAudioVolumeIndication callback. |
| onFirstLocalAudioFramePublished | Callback triggered when the local user publishes the first audio frame. |
| onLocalAudioStateChanged | Callback for changes in the local audio stream state. |
| onLocalAudioStats | Callback for local audio statistics. |
| onRemoteAudioStateChanged | Callback for changes in the remote audio state. |
| onRemoteAudioStats | Callback for remote audio stream statistics. |
| onUserMuteAudio | Callback for remote user or host stopping or resuming audio stream. |
Audio Capture
| API | Description |
|---|---|
| adjustLoopbackSignalVolume | Adjusts the volume of the loopback recording signal. |
| adjustRecordingSignalVolume | Adjusts the volume of the recorded audio signal. |
| enableInEarMonitoring | Enables or disables in-ear monitoring. |
| enableLocalAudio | Enables or disables local audio capture. |
| enableLoopbackRecording | Enables loopback recording using the sound card. |
| enableLoopbackRecordingEx | Enables loopback recording, mixing the sound card output into the audio stream sent. |
| muteRecordingSignal | Mutes or unmutes the recording signal. |
| setInEarMonitoringVolume | Sets the in-ear monitoring volume. |
Audio Effects
| API | Description |
|---|---|
| enableVoiceAITuner | Enables or disables the Voice AI Tuner. |
| setAdvancedAudioOptions | Sets advanced audio options. |
| setAINSMode | Enables or disables AI noise suppression and sets the suppression mode. |
| setAudioEffectParameters | Sets parameters for the SDK's preset audio effects. |
| setAudioEffectPreset | Sets the SDK's preset audio effects. |
| setLocalVoiceEqualization | Sets the equalization effect of the local voice. |
| setLocalVoiceFormant | Sets the formant ratio to change the voice timbre. |
| setLocalVoicePitch | Sets the pitch of the local voice. |
| setLocalVoiceReverb | Sets the reverb effect of the local voice. |
| setVoiceBeautifierParameters | Sets parameters for preset voice beautifier effects. |
| setVoiceBeautifierPreset | Sets the preset voice beautifier effect. |
| setVoiceConversionPreset | Sets the preset voice conversion effects. |
Stereo
| API | Description |
|---|---|
| enableSoundPositionIndication | Enables or disables stereo panning for remote users. |
| setRemoteVoicePosition | Sets the position and volume of a remote user's voice on the horizontal plane. |
| setRemoteVoicePositionEx | Sets the 2D position and volume of the remote user's voice. |
Spatial Audio
| API | Description |
|---|---|
| initialize | Initializes ILocalSpatialAudioEngine. |
| clearRemotePositions | Removes the spatial positions of all remote users. |
| enableSpatialAudio | Enables or disables spatial audio. |
| muteAllRemoteAudioStreams | Stops or resumes subscribing to all remote users' audio streams. |
| muteLocalAudioStream | Stops or resumes publishing the local audio stream. |
| muteRemoteAudioStream | Stops or resumes subscribing to the specified remote user's audio stream. |
| release | Releases all resources of ILocalSpatialAudioEngine. |
| removeRemotePosition | Removes the spatial position information of the specified remote user. |
| setAudioRecvRange | Sets the local user's audio reception range. |
| setDistanceUnit | Sets the number of meters corresponding to each unit of distance in the game engine. |
| setHeadphoneEQParameters | Sets the low and high frequency parameters of the headphone equalizer. |
| setHeadphoneEQPreset | Sets the preset headphone equalizer effect. |
| setMaxAudioRecvCount | Sets the maximum number of audio streams you can receive within the specified audio reception range. |
| setPlayerAttenuation | Sets the audio attenuation properties for the media player. |
| setRemoteAudioAttenuation | Sets the audio attenuation effect for a specified user. |
| setRemoteUserSpatialAudioParams | Sets spatial audio parameters for remote users. |
| setSpatialAudioParams | Enables or disables spatial audio for the media player. |
| setZones | Sets sound insulation zones. |
| updatePlayerPositionInfo | Updates the spatial position of the media player. |
| updateRemotePosition | Updates the spatial position of the specified remote user. |
| updateSelfPosition | Updates the local user's spatial position. |
Audio Mixer
| API | Description |
|---|---|
| startLocalAudioMixer | Starts local audio mixing. |
| stopLocalAudioMixer | Stops local audio mixing. |
| updateLocalAudioMixerConfiguration | Updates the local audio mixing configuration. |
Raw Audio Data
| API | Description |
|---|---|
| getEarMonitoringAudioParams | Callback for setting the audio format of the onEarMonitoringAudioFrame callback. |
| getMixedAudioParams | Callback for setting the audio format of the onMixedAudioFrame callback. |
| getObservedAudioFramePosition | Sets the audio data observation position. |
| getPlaybackAudioParams | Sets the audio format for the onPlaybackAudioFrame callback. |
| getRecordAudioParams | Callback for setting the audio format of the onRecordAudioFrame callback. |
| registerAudioFrameObserver | Registers an audio frame observer object. |
| setEarMonitoringAudioFrameParameters | Sets the format of the ear monitoring audio data. |
| setMixedAudioFrameParameters | Sets the format of the mixed raw audio data used for capture and playback. |
| setPlaybackAudioFrameBeforeMixingParameters [1/2] | Sets the format of raw audio playback data before mixing. |
| setPlaybackAudioFrameBeforeMixingParameters [2/2] | Sets the format of the audio data returned in the onPlaybackAudioFrameBeforeMixing callback. |
| setPlaybackAudioFrameParameters | Sets the format of the raw playback audio data. |
| setRecordingAudioFrameParameters | Sets the format of the captured raw audio data. |
| onEarMonitoringAudioFrame | Ear monitoring audio frame callback. |
| onMixedAudioFrame | Callback for mixed capture and playback audio frame. |
| onPlaybackAudioFrame | onPlaybackAudioFrame callback: retrieves the raw audio frame for playback. |
| onPlaybackAudioFrameBeforeMixing | Callback for retrieving the audio frame of a subscribed remote user before mixing. |
| onRecordAudioFrame | Callback triggered when an audio frame is captured. |
Encoded Audio Data
| API | Description |
|---|---|
| registerAudioEncodedFrameObserver | Registers an observer for encoded audio data. |
| onMixedAudioEncodedFrame | Callback for mixed encoded audio data of the local and all remote users. |
| onPlaybackAudioEncodedFrame | Callback for retrieving encoded audio data of all remote users. |
| onRecordAudioEncodedFrame | Callback for encoded audio data of the local user. |
Custom Audio Capture and Rendering
| API | Description |
|---|---|
| adjustCustomAudioPlayoutVolume | Adjusts the volume of custom audio tracks played locally. |
| adjustCustomAudioPublishVolume | Adjusts the volume of custom audio tracks played remotely. |
| createCustomAudioTrack | Creates a custom audio track. |
| destroyCustomAudioTrack | Destroys the specified audio track. |
| enableCustomAudioLocalPlayback | Enables or disables local playback of external audio sources. |
| pullAudioFrame | Pulls mixed remote audio data. |
| pushAudioFrame | Pushes external audio frames. |
| setExternalAudioSink | Sets the external audio renderer. |
Audio Spectrum
| API | Description |
|---|---|
| disableAudioSpectrumMonitor | Disables audio spectrum monitoring. |
| enableAudioSpectrumMonitor | Enables audio spectrum monitoring. |
| registerAudioSpectrumObserver | Registers an audio spectrum observer. |
| unregisterAudioSpectrumObserver | Unregisters the audio spectrum observer. |
| onLocalAudioSpectrum | Callback for local audio spectrum data. |
| onRemoteAudioSpectrum | Callback for remote audio spectrum. |
Video Basic Features
| API | Description |
|---|---|
| disableVideo | Disables the video module. |
| enableLocalVideo | Enables or disables local video capture. |
| enableVideo | Enables the video module. |
| setVideoEncoderConfiguration | Sets the encoder configuration for the local video. |
| setVideoEncoderConfigurationEx | Sets the encoder configuration for the local video. |
| setVideoScenario | Sets the video application scenario. |
| startPreview [1/2] | Enables local video preview. |
| startPreview [2/2] | Enables local video preview and specifies the video source to preview. |
| stopPreview [1/2] | Stops the local video preview. |
| stopPreview [2/2] | Stops the local video preview. |
| onFirstLocalVideoFrame | Callback triggered when the first local video frame is displayed in the local view. |
| onFirstLocalVideoFramePublished | Callback triggered when the first local video frame is published. |
| onFirstRemoteVideoFrame | Callback when the first frame of remote video is displayed. |
| onLocalVideoEvent | Callback triggered when a local video event occurs. |
| onLocalVideoStateChanged | Callback for local video state changes. |
| onLocalVideoStats | Callback for local video stream statistics. |
| onRemoteVideoStateChanged | Callback for remote video state changes. |
| onRemoteVideoStats | Callback for statistics of video streams sent by remote users. |
| onUserEnableVideo | Callback triggered when a remote user enables or disables the video module. |
| onUserMuteVideo | Callback for changes in remote video publishing state. |
| onVideoPublishStateChanged | Callback for video publishing state changes. |
| onVideoSizeChanged | Triggered when the video size or rotation of a specified user changes. |
Camera Capture
| API | Description |
|---|---|
| setCameraStabilizationMode | Sets the camera stabilization mode. |
| startCameraCapture | Starts video capture. |
| stopCameraCapture | Stops video capture. |
Screen Capture
| API | Description |
|---|---|
| getCount | Gets the number of shareable windows and screens. |
| getScreenCaptureSources | Gets the list of shareable screens and windows. |
| getSourceInfo | Gets information about the specified shareable window or screen. |
| queryScreenCaptureCapability | Queries the maximum frame rate supported by the device during screen sharing. |
| release | Releases IScreenCaptureSourceList. |
| setExternalMediaProjection | Configures an external MediaProjection for the SDK to capture screen video streams. |
| setScreenCaptureContentHint | Sets the content hint for screen sharing. |
| setScreenCaptureScenario | Sets the screen sharing scenario. |
| startScreenCapture [1/2] | Starts screen capture. |
| startScreenCapture [2/2] | Starts screen capture from the specified video source. |
| startScreenCaptureByDisplayId | Captures the screen by specifying a display ID. |
| startScreenCaptureByWindowId | Captures the entire or part of a window by specifying the window ID. |
| stopScreenCapture [1/2] | Stops screen capture. |
| stopScreenCapture [2/2] | Stops video capture from the specified video source. |
| updateScreenCapture | Updates screen capture parameters. |
| updateScreenCaptureParameters | Updates screen capture parameters. |
| updateScreenCaptureRegion | Updates the screen sharing region. |
Snapshot
| API | Description |
|---|---|
| enableContentInspect | Enables or disables the local snapshot upload feature. |
| enableContentInspectEx | Enables or disables the local snapshot upload feature. |
| takeSnapshot [1/2] | Takes a snapshot of the video stream. |
| takeSnapshot [2/2] | Takes a snapshot of the specified view. |
| takeSnapshotEx [1/2] | Takes a snapshot of the specified user's video stream using the connection ID. |
| takeSnapshotEx [2/2] | Captures a snapshot of the specified user's video using the connection ID. |
| onSnapshotTaken | Snapshot result callback. |
Virtual Background
| API | Description |
|---|---|
| enableVirtualBackground | Enables or disables the virtual background feature. |
Local Video Transcoding
| API | Description |
|---|---|
| startLocalVideoTranscoder | Starts local video compositing. |
| stopLocalVideoTranscoder | Stops local video mixing. |
| updateLocalTranscoderConfiguration | Updates the local video mixing configuration. |
| onLocalVideoTranscoderError | Callback triggered when an error occurs during local video mixing. |
Video Enhancement
| API | Description |
|---|---|
| addOrUpdateVideoEffect | Adds or updates the effect of the specified video effect node and template. |
| createVideoEffectObject | Creates an IVideoEffectObject video effect object. |
| destroyVideoEffectObject | Destroys a video effect object. |
| getFaceShapeAreaOptions | Gets beauty area options. |
| getFaceShapeBeautyOptions | Gets beauty options. |
| getVideoEffectBoolParam | Retrieves a boolean parameter from the video effect. |
| getVideoEffectFloatParam | Retrieves the value of a specified float type parameter from the video effect. |
| getVideoEffectIntParam | Retrieves an integer type parameter from the video effect. |
| performVideoEffectAction | Performs an action on the specified video effect node. |
| removeVideoEffect | Removes the video effect with the specified node ID. |
| setBeautyEffectOptions | Sets beauty effect options. |
| setColorEnhanceOptions | Sets video color enhancement effects. |
| setFaceShapeAreaOptions | Sets beauty effect options for facial areas and specifies the media source. |
| setFaceShapeBeautyOptions | Sets face shaping options and specifies the media source. |
| setFilterEffectOptions | Sets filter effect options and specifies the media source. |
| setLowlightEnhanceOptions | Sets the low-light enhancement feature. |
| setVideoDenoiserOptions | Enables video denoising. |
| setVideoEffectBoolParam | Sets a boolean parameter for the video effect. |
| setVideoEffectFloatParam | Sets a float parameter for the video effect. |
| setVideoEffectIntParam | setVideoEffectIntParam: Sets an integer parameter for the video effect. |
Face Detection
| API | Description |
|---|---|
| enableFaceDetection | Enables or disables face detection for the local user. |
| onFacePositionChanged | Reports the local user's face detection results. |
Center Stage
| API | Description |
|---|---|
| enableCameraCenterStage | Enables or disables Center Stage. |
| isCameraCenterStageSupported | Checks whether the current camera supports Center Stage. |
Watermark
| API | Description |
|---|---|
| addVideoWatermark [3/3] | Adds a watermark image to the local video stream. |
| addVideoWatermarkEx [2/2] | Adds a watermark image to the local video. |
| clearVideoWatermarkEx | Removes the watermark image from the video stream. |
| clearVideoWatermarks | Removes watermark images from the video stream. |
| removeVideoWatermark | Removes a watermark image from the local video. |
| removeVideoWatermarkEx | Removes the specified watermark image from the local or remote video stream. |
Image Source
| API | Description |
|---|---|
| enableVideoImageSource | Sets whether to replace the current video with an image when publishing the video stream. |
Video Rendering
| API | Description |
|---|---|
| enableInstantMediaRendering | Enables instant rendering of audio and video frames. |
| setLocalRenderMode [2/2] | Updates the display mode of the local video view. |
| setLocalRenderTargetFps | Sets the maximum frame rate for local video rendering. |
| setRemoteRenderMode | Updates the display mode of the remote user's video view. |
| setRemoteRenderModeEx | Sets the video render mode for a specified remote user. |
| setRemoteRenderTargetFps | Sets the maximum frame rate for remote video rendering. |
| setRenderMode | Sets the render mode of the media player. |
| setupLocalVideo | Initializes the local video view. |
| setupRemoteVideo | Initializes the video view of a remote user. |
| setupRemoteVideoEx | Initializes the video view of a remote user. |
| startMediaRenderingTracing | Enables tracing of the video frame rendering process. |
| startMediaRenderingTracingEx | Enables tracing of the video frame rendering process. |
| onTranscodedStreamLayoutInfo | Triggered when the local user receives a mixed video stream with video layout information. |
| onVideoRenderingTracingResult | Callback for video frame rendering events. |
Raw Video Data
| API | Description |
|---|---|
| getMirrorApplied | Callback triggered each time the SDK receives a video frame, used to set whether to mirror the captured video. |
| getObservedFramePosition | Sets the frame position for the video observer. |
| getRotationApplied | Callback indicating whether to rotate the captured video. |
| getVideoFormatPreference | Sets the format of raw video data output by the SDK. |
| getVideoFrameProcessMode | getVideoFrameProcessMode callback. Triggered each time the SDK receives a video frame to set the video frame processing mode. |
| registerVideoFrameObserver | Registers a raw video frame observer object. |
| onCaptureVideoFrame | Callback for locally captured video frames. |
| onFrame | Callback triggered when the player receives a video frame. |
| onPreEncodeVideoFrame | Callback for pre-encoded video frames. |
| onRenderVideoFrame | Callback triggered when receiving a video frame sent by a remote user. |
Encoded Video Data
| API | Description |
|---|---|
| registerVideoEncodedFrameObserver | Registers an observer object to receive encoded video frames. |
| onEncodedVideoFrameReceived | Reports that the receiver has received the encoded video frame sent by the remote user. |
Custom Video Capture and Rendering
| API | Description |
|---|---|
| createCustomVideoTrack | Creates a custom video track. |
| destroyCustomVideoTrack | Destroys the specified video track. |
| pushVideoFrame | Pushes external raw video frames to the SDK via a video track. |
| setExternalRemoteEglContext | Sets the EGL context used to render remote video streams. |
| setExternalVideoSource | Configures an external video source. |
Audio Mixing
| API | Description |
|---|---|
| adjustAudioMixingPlayoutVolume | Adjusts the local playback volume of the audio mixing. |
| adjustAudioMixingPublishVolume | Adjusts the audio mixing volume for publishing. |
| adjustAudioMixingVolume | Adjusts the local and remote audio mixing volume. |
| getAudioMixingCurrentPosition | Gets the current playback progress (ms) of the audio mixing. |
| getAudioMixingDuration | Gets the total duration (ms) of the audio mixing file. |
| getAudioMixingPlayoutVolume | Gets the local playback volume of the audio mixing. |
| getAudioMixingPublishVolume | Gets the audio mixing volume for publishing. |
| getAudioTrackCount | Gets the audio track index of the current music file. |
| pauseAudioMixing | Pauses the playback and mixing of the music file. |
| resumeAudioMixing | Resumes the playback and mixing of the music file. |
| selectAudioTrack [1/2] | Selects the audio track to use during playback. |
| selectMultiAudioTrack | Selects the audio track for local playback and publishing to the channel. |
| setAudioMixingDualMonoMode | Sets the channel mode of the current audio file. |
| setAudioMixingPitch | Sets the pitch of the local music file. |
| setAudioMixingPlaybackSpeed | Sets the playback speed of the current audio file. |
| setAudioMixingPosition | Sets the starting playback position of the audio mixing file. |
| startAudioMixing [2/2] | Starts playing a music file. |
| stopAudioMixing | Stops playing the music file. |
| onAudioMixingPositionChanged | Callback that reports the playback progress of the music file. |
| onAudioMixingStateChanged | Callback for music file playback state changes. |
Audio Effect Files
| API | Description |
|---|---|
| getEffectCurrentPosition | Gets the playback position of the specified audio effect file. |
| getEffectDuration | Gets the duration of an audio effect file. |
| getEffectsVolume | Gets the current volume of sound effects. |
| getVolumeOfEffect | Gets the volume of the specified audio effect file. |
| pauseAllEffects | Pauses all audio effects. |
| pauseEffect | Pauses the playback of the specified audio effect file. |
| playAllEffects | Plays all audio effect files. |
| playEffect | Plays the specified local or online audio effect file. |
| playEffectEx | Plays the specified sound effect in the channel. |
| preloadEffect | Preloads the specified audio effect file. |
| preloadEffectEx | Preloads the specified sound effect into the channel. |
| resumeAllEffects | Resumes playing all audio effect files. |
| resumeEffect | Resumes playback of the specified audio effect. |
| setEffectPosition | Sets the playback position of the audio effect file. |
| setEffectsVolume | Sets the playback volume of sound effects. |
| setVolumeOfEffect | Sets the playback volume of the specified audio effect file. |
| stopAllEffects | Stops playing all audio effects. |
| stopEffect | Stops playing the specified audio effect. |
| unloadAllEffects | Releases all preloaded audio effects from memory. |
| unloadEffect | Releases the specified preloaded audio effect file. |
| onAudioEffectFinished | Callback triggered when the local audio effect file finishes playing. |
Media Player Initialization
| API | Description |
|---|---|
| createMediaPlayer | Creates an IMediaPlayer object. |
| destroyMediaPlayer | Destroys an IMediaPlayer instance. |
| getMediaPlayerCacheManager | Gets an IMediaPlayerCacheManager instance. |
Media Resource Open
| API | Description |
|---|---|
| open | Opens a media resource. |
| openWithMediaSource | Opens a media file and configures the playback scenario. |
| preloadSrc | Preloads media resources. |
| switchSrc | Switches the currently playing media resource. |
| unloadSrc | Unloads preloaded media resources. |
Media Resource Playback and Rendering
| API | Description |
|---|---|
| selectAudioTrack [2/2] | Selects the audio track used during playback. |
| setAudioDualMonoMode | Sets the channel mode of the current audio file. |
| setAudioPitch | Sets the pitch of the current media resource. |
| setLoopCount | Sets the number of times the audio effect loops. |
| setPlaybackSpeed | Sets the playback speed of the current audio file. |
| setPlayerOption [1/2] | Sets media player options. |
| setPlayerOption [2/2] | Sets parameter options for the media player. |
| setView | Sets the view. |
Media Player Control
| API | Description |
|---|---|
| adjustPlayoutVolume | Adjusts the local playback volume. |
| adjustPublishSignalVolume | Adjusts the volume of the media file for publishing. |
| mute | Sets whether to mute the media file. |
| pause | Pauses playback. |
| play | Plays the media file. |
| playPreloadedSrc | Plays a preloaded media resource. |
| resume | Resumes playing the media file. |
| seek | Jumps to a new playback position. |
| stop | Stops playing the media track. |
| onSeek | Callback triggered when seeking media resource data. |
Media Player Information
| API | Description |
|---|---|
| getAudioBufferDelay | Gets the audio buffer delay when playing media files. |
| getDuration | Gets the duration of the media resource. |
| getMediaPlayerId | Gets the ID of the media player. |
| getMute | Checks whether the media resource is muted. |
| getPlayoutVolume | Gets the local playback volume. |
| getPlayPosition | Gets the local playback position of the current sound effect file. |
| getPlaySrc | Gets the path of the media resource being played. |
| getPublishSignalVolume | Gets the volume of the media file for publishing. |
| getState | Gets current playback state. |
| getStreamCount | Gets the number of media streams in the media resource. |
| getStreamInfo | Gets detailed information about a media stream. |
| onPlayerPlaybackStats | Callback for statistics of the media file being played. |
Media Player Observer
| API | Description |
|---|---|
| registerAudioFrameObserver [1/2] | Registers an IAudioPcmFrameSink audio frame observer object. |
| registerAudioFrameObserver [2/2] | Registers an audio frame observer object. |
| registerPlayerSourceObserver | Registers the media player observer. |
| registerVideoFrameObserver | Registers a video frame observer object. |
| unregisterAudioFrameObserver | Unregisters the audio frame observer. |
| unregisterPlayerSourceObserver | Releases the media player observer. |
| unregisterVideoFrameObserver | Unregisters the video frame observer. |
| onAudioVolumeIndication | Callback that reports the media player volume. |
| onFrame | onFrame callback. Triggered each time the player receives an audio frame. |
| onMetaData [1/2] | Callback triggered when media metadata is received. |
| onPlayBufferUpdated | Reports the playback duration supported by the buffered data. |
| onPlayerEvent | Player event callback. |
| onPlayerInfoUpdated [1/2] | onPlayerInfoUpdated callback: Occurs when media player information changes. |
| onPlayerSourceStateChanged | Callback for playback state changes. |
| onPlayerSrcInfoChanged | Callback that occurs when the video bitrate of the media source changes. |
| onPositionChanged | Callback when playback progress changes. |
| onPreloadEvent | Callback for preloading media resource events. |
| onReadData | Callback triggered when the SDK reads media resource data. |
Media Player Cache
| API | Description |
|---|---|
| enableAutoRemoveCache | Sets whether to automatically delete cached media files. |
| getCacheDir | Gets the storage path for media files to be cached. |
| getCacheFileCount | Gets the number of cached media files. |
| getMaxCacheFileCount | Gets the maximum number of media files that can be cached. |
| getMaxCacheFileSize | Gets the maximum aggregate storage size of cached media files. |
| removeAllCaches | Deletes all cached media files in the media player. |
| removeCacheByUri | Deletes cached media files. |
| removeOldCache | Deletes the least-used cached media file. |
| setCacheDir | Sets the storage path for cached media files. |
| setMaxCacheFileCount | Sets the maximum number of media files that can be cached. |
| setMaxCacheFileSize | Sets the maximum total storage size for cached media files. |
| onPlayerCacheStats | Reports statistics of the media file being cached. |
Digital Rights Management
| API | Description |
|---|---|
| createMusicPlayer | Creates a music player. |
| destroyMusicPlayer | Destroys the music player object. |
| get | Gets the detailed information of the specified music chart. |
| getCaches | Retrieves information about cached music resources. |
| getCount [1/2] | Gets the number of music charts in the current request. |
| getCount [2/2] | Gets the number of music items in the current request. |
| getInternalSongCode | Creates an internal song code for the chorus segment of a music resource. |
| getLyric | Retrieves the download link for the lyrics of a music resource. |
| getMusic | Retrieves detailed information of the specified music resource on the current page. |
| getMusicCharts | Retrieves all music charts. |
| getMusicCollectionByMusicChartId | Retrieves the list of music resources for the specified music chart ID. |
| getPage | Gets the current page number of the music resource list. |
| getPageSize | Gets the actual number of music resources returned by the SDK. |
| getSongSimpleInfo | Retrieves detailed information of the specified music resource. |
| getTotal | Gets the total number of music resources in the list. |
| initialize | Initializes IMusicContentCenter. |
| isPreloaded | Checks whether the specified music resource has been preloaded. |
| open | Opens a music resource using the song code. |
| preload [2/2] | Preloads music resources. |
| registerEventHandler | Registers the event handler for MusicContentCenter. |
| release | Releases all resources used by MusicContentCenter. |
| removeCache | Deletes a cached music resource. |
| renewToken | Updates the Token. |
| searchMusic | Searches for music resources. |
| setPlayMode | Sets the playback mode for the music resource. |
| unregisterEventHandler | Unregisters the event callback for MusicContentCenter. |
| onLyricResult | Callback for retrieving the lyric download URL. |
| onMusicChartsResult | Callback for retrieving music chart results. |
| onMusicCollectionResult | Callback for retrieving the music resource list. |
| onPreLoadEvent | Callback for events related to preloading music resources. |
| onSongSimpleInfoResult | Callback for retrieving detailed information about a music resource. |
Recording
| API | Description |
|---|---|
| createMediaRecorder | Creates an audio and video recorder instance. |
| destroyMediaRecorder | Destroys the audio and video recorder object. |
| setMediaRecorderObserver | Registers the IMediaRecorderObserver observer. |
| startAudioRecording [1/3] | Starts client-side audio recording and sets the recording sample rate. |
| startAudioRecording [2/3] | Starts client-side audio recording and sets the recording sample rate. |
| startAudioRecording [3/3] | Starts client-side audio recording and sets recording parameters. |
| startRecording | Starts recording audio and video streams. |
| stopAudioRecording | Stops client-side audio recording. |
| stopRecording | Stops recording of audio and video streams. |
| onRecorderInfoUpdated | Callback when recording information is updated. |
| onRecorderStateChanged | Callback when the recording state changes. |
Cross-Channel Media Relay
| API | Description |
|---|---|
| pauseAllChannelMediaRelay | Pauses the media stream relay to all destination channels. |
| pauseAllChannelMediaRelayEx | Pauses media stream relay to all destination channels. |
| resumeAllChannelMediaRelay | Resumes the media stream relay to all destination channels. |
| resumeAllChannelMediaRelayEx | Resumes media stream relay to all destination channels. |
| startOrUpdateChannelMediaRelay | Starts media stream relay across channels or updates the target channels for the relay. |
| startOrUpdateChannelMediaRelayEx | Starts or updates the media stream relay across channels. |
| stopChannelMediaRelay | Stops the media stream relay across channels. |
| stopChannelMediaRelayEx | Stops media stream relay across channels. |
| onChannelMediaRelayStateChanged | Callback for changes in channel media relay state. |
Media Push
| API | Description |
|---|---|
| startRtmpStreamWithoutTranscoding | Starts pushing media streams to CDN without transcoding. |
| startRtmpStreamWithoutTranscodingEx | Starts pushing media streams to the CDN without transcoding. |
| startRtmpStreamWithTranscoding | Starts CDN streaming with transcoding configuration. |
| startRtmpStreamWithTranscodingEx | Starts RTMP streaming and sets the transcoding configuration. |
| stopRtmpStream | Stops pushing media streams to the specified CDN address. |
| stopRtmpStreamEx | Stops pushing media streams to the specified CDN address. |
| updateRtmpTranscoding | Updates the transcoding configuration for CDN streaming. |
| updateRtmpTranscodingEx | Updates the transcoding configuration for RTMP streaming. |
| onRtmpStreamingEvent | Reports events during RTMP streaming. |
| onRtmpStreamingStateChanged | Callback triggered when the RTMP streaming state changes. |
| onTranscodingUpdated | Callback triggered when the publisher's cloud transcoding settings are updated. |
CDN Streaming
| API | Description |
|---|---|
| onDirectCdnStreamingStateChanged | Callback for CDN streaming state changes. |
| onDirectCdnStreamingStats | Callback for reporting CDN streaming statistics. |
Data Stream
| API | Description |
|---|---|
| createDataStream [1/2] | Creates a data stream. |
| createDataStream [2/2] | Creates a data stream. |
| createDataStreamEx [1/2] | Creates a data stream. |
| createDataStreamEx [2/2] | Creates a data stream. |
| sendStreamMessage | Sends a data stream message. |
| sendStreamMessageEx | Sends a data stream message. |
| onStreamMessage | onStreamMessage callback: Triggered when a remote user sends a data stream. |
| onStreamMessageError | Callback triggered when the local user fails to receive a data stream message sent by a remote user. |
Metadata (SEI)
| API | Description |
|---|---|
| getMaxMetadataSize | Callback triggered when the SDK requests the maximum size of metadata. |
| registerMediaMetadataObserver | Registers a metadata observer. |
| unregisterMediaMetadataObserver | Unregisters the specified metadata observer. |
| onMetadataReceived | Callback triggered when the local user receives metadata. |
| onReadyToSendMetadata | Callback triggered when the SDK is ready to send metadata. |
Audio Route
| API | Description |
|---|---|
| isSpeakerphoneEnabled | Checks whether the speaker is enabled. |
| setDefaultAudioRouteToSpeakerphone | Sets the default audio playback route. |
| setEnableSpeakerphone | Sets whether to switch the audio route to the speaker. |
| setRouteInCommunicationMode | Sets the audio playback route in communication mode. |
| onAudioRoutingChanged | Callback triggered when the local audio routing changes. |
Video Device Management
| API | Description |
|---|---|
| enableMultiCamera | Enables or disables multi-camera capture. |
| enumerateVideoDevices | Enumerates video devices in the system. |
| getCameraMaxZoomFactor | Gets the maximum zoom factor supported by the camera. |
| getCapability | Retrieves frame information of the video capture device under the specified video format. |
| getCount | Gets the total number of indexed video capture devices in the system. |
| getDevice | Gets information of the video device at the specified index. |
| getDevice | Gets the current video capture device. |
| isCameraAutoExposureFaceModeSupported | Checks whether the device supports auto exposure. |
| isCameraAutoFocusFaceModeSupported | Checks whether the device supports face auto-focus. |
| isCameraExposurePositionSupported | Checks whether the device supports manual exposure. |
| isCameraExposureSupported | Checks whether the current camera supports exposure adjustment. |
| isCameraFaceDetectSupported | Checks whether the device camera supports face detection. |
| isCameraFocusSupported | Checks whether the device supports manual focus. |
| isCameraTorchSupported | Checks whether the device supports camera torch. |
| isCameraZoomSupported | Checks whether the device supports camera zoom. |
| numberOfCapabilities | Gets the number of video formats supported by the specified video capture device. |
| queryCameraFocalLengthCapability | Queries the focal length capabilities supported by the camera. |
| queryCodecCapability | Queries the video codec capabilities supported by the SDK. |
| release | Releases all resources occupied by the IVideoDeviceCollection object. |
| release | Releases all resources occupied by the IVideoDeviceManager object. |
| setCameraAutoExposureFaceModeEnabled | Sets whether to enable auto exposure. |
| setCameraAutoFocusFaceModeEnabled | Enables the camera auto-face focus function. |
| setCameraCapturerConfiguration | Sets the camera capture configuration. |
| setCameraDeviceOrientation | Sets the rotation angle of captured video. |
| setCameraExposureFactor | Sets the camera exposure value. |
| setCameraExposurePosition | Sets the camera exposure position. |
| setCameraFocusPositionInPreview | Sets the manual focus position of the camera. |
| setCameraTorchOn | Turns the camera flash on or off. |
| setCameraZoomFactor | Sets the camera zoom factor. |
| setDevice | Specifies the device corresponding to the device ID. |
| setDevice | Specifies the device ID of the video capture device. |
| switchCamera | Switches between front and rear cameras. |
| onCameraExposureAreaChanged | Callback for changes in camera exposure area. |
| onCameraFocusAreaChanged | onCameraFocusAreaChanged callback. Triggered when the camera focus area changes. |
| onVideoDeviceStateChanged | Callback for video device state changes. |
Audio Device Management
| API | Description |
|---|---|
| enumeratePlaybackDevices | Enumerates audio playback devices in the system. |
| enumerateRecordingDevices | Enumerates audio recording devices. |
| followSystemLoopbackDevice | Sets whether to follow the system default audio playback device. |
| followSystemPlaybackDevice | Sets whether the SDK follows the system default audio playback device. |
| followSystemRecordingDevice | Sets whether the SDK follows the system default audio recording device. |
| getApplicationVolume | Retrieves the app volume. |
| getAudioDeviceInfo | Retrieves audio device information. |
| getCount | Gets the total number of audio playback or audio capture devices. |
| getDefaultDevice [2/2] | Retrieves the system default audio device and its type. |
| getDefaultDevice [1/2] | Retrieves the system default audio device. |
| getDevice [2/2] | Gets the name, type, and ID of the audio device by index. |
| getDevice [1/2] | Gets the information of the video device at the specified index. |
| getLoopbackDevice | Gets the current loopback capture device. |
| getPlaybackDevice | Retrieves the audio playback device associated with the device ID. |
| getPlaybackDeviceInfo [1/2] | Retrieves information of the audio playback device. |
| getPlaybackDeviceInfo [2/2] | Retrieves the information and type of the audio playback device. |
| getPlaybackDeviceMute | Gets the mute status of the audio playback device. |
| getPlaybackDeviceVolume | Retrieves the volume of the audio playback device. |
| getRecordingDevice | Gets the device ID of the current audio recording device. |
| getRecordingDeviceInfo [1/2] | Gets information about the audio recording device. |
| getRecordingDeviceInfo [2/2] | Gets the information and type of the audio recording device. |
| getRecordingDeviceMute | Gets the mute state of the audio recording device. |
| getRecordingDeviceVolume | Gets the volume of the audio recording device. |
| isApplicationMute | Checks whether the app is muted. |
| release | Releases all resources occupied by the IAudioDeviceCollection object. |
| release | Releases all resources occupied by the IAudioDeviceManager object. |
| setApplicationMute | Sets whether the app is muted. |
| setApplicationVolume | Sets the application volume. |
| setDevice | Specifies the device ID of the video capture device. |
| setLoopbackDevice | Sets the SDK's loopback capture device. |
| setPlaybackDevice | Sets the audio playback device. |
| setPlaybackDeviceMute | Sets whether to mute the audio playback device. |
| setPlaybackDeviceVolume | Sets the volume of the audio playback device. |
| setRecordingDevice | Sets the audio recording device. |
| setRecordingDeviceMute | Sets the mute state of the audio recording device. |
| setRecordingDeviceVolume | Sets the volume of the audio recording device. |
| startAudioDeviceLoopbackTest | Starts the audio device loopback test. |
| startPlaybackDeviceTest | Starts a local audio playback device test. |
| startRecordingDeviceTest | Starts an audio recording device test. |
| stopAudioDeviceLoopbackTest | Stops the audio device loopback test. |
| stopPlaybackDeviceTest | Stops the audio playback device test. |
| stopRecordingDeviceTest | Stops the audio capturing device test. |
| onAudioDeviceStateChanged | Callback when the audio device state changes. |
| onAudioDeviceVolumeChanged | Callback triggered when the audio device or app volume changes. |
Extensions
| API | Description |
|---|---|
| enableExtension | Enables or disables an extension. |
| getExtensionProperty | Gets the properties of an extension. |
| loadExtensionProvider | Loads an extension. |
| registerExtension | Registers an extension. |
| setExtensionProperty | Sets the properties of an extension. |
| setExtensionProviderProperty | Sets the properties of an extension provider. |
| onExtensionErrorWithContext | Callback triggered when the extension encounters a runtime error. |
| onExtensionEventWithContext | Callback for extension events. |
| onExtensionStartedWithContext | onExtensionStartedWithContext callback. Triggered when the extension is successfully enabled. |
| onExtensionStoppedWithContext | onExtensionStoppedWithContext callback: Triggered when the extension is disabled. |
Network and Others
| API | Description |
|---|---|
| complain | Allows users to report call quality issues after the call ends. |
| enableEncryption | Enables or disables the built-in encryption feature. |
| enableEncryptionEx | Enables or disables built-in encryption. |
| getCallId | Gets the current call ID. |
| getCallIdEx | Retrieves the call ID corresponding to the connection ID. |
| getConnectionState | Gets the current SDK connection state. |
| getConnectionStateEx | Gets the current connection state of the SDK. |
| getCurrentMonotonicTimeInMs | Gets the SDK's current monotonic time. |
| getErrorDescription | getErrorDescription: gets the warning or error description. |
| getNetworkType | Gets the local network connection type. |
| getNtpWallTimeInMs | Gets the current NTP (Network Time Protocol) time. |
| getVersion | Gets the SDK version number. |
| isFeatureAvailableOnDevice | Checks whether the current device supports the specified advanced feature. |
| queryDeviceScore | Queries the device score. |
| queryInterface | Gets the pointer to the specified interface. |
| rate | Allows users to rate the call after it ends. |
| registerPacketObserver | Registers a packet observer. |
| sendCustomReportMessage | Sends a custom report message. |
| sendCustomReportMessageEx | Supports reporting and analyzing custom messages. |
| setAVSyncSource | Sets audio-video synchronization at the sender side. |
| setCloudProxy | Sets the cloud proxy service. |
| setLocalAccessPoint | Configures access to the Agora private media server access module. |
| setParameters | Provides technical preview features or special customization for the SDK via JSON configuration. |
| setRemoteSubscribeFallbackOption | Sets the fallback option for the subscribed video stream based on network conditions. |
| startEchoTest | Starts the audio and video call loop test. |
| startLastmileProbeTest | Starts the last-mile network probe test. |
| stopEchoTest | Stops the audio call test. |
| stopLastmileProbeTest | Stops the last-mile network probe test. |
| onConnectionLost | onConnectionLost callback. Triggered when the SDK fails to reconnect to the Agora edge server within 10 seconds after the connection is lost. |
| onConnectionStateChanged | Callback triggered when the network connection state changes. |
| onEncryptionError | Callback for reporting built-in encryption errors. |
| onLastmileProbeResult | Callback for uplink and downlink last-mile network probe results. |
| onLastmileQuality | Callback reporting the last-mile network quality of the local user. |
| onMultipathStats | Callback for multipath transmission statistics. |
| onNetworkQuality | Reports the last-mile network quality of each user in the channel. |
| onNetworkTypeChanged | Callback triggered when the local network type changes. |
| onPermissionError | Reports when the SDK fails to obtain device permissions. |
| onPermissionGranted | Callback triggered when a permission is granted. |
| onProxyConnected | Proxy connection status callback. |
| onReceiveAudioPacket | Callback triggered when the local user receives an audio packet. |
| onReceiveVideoPacket | Callback triggered when the local user receives a video packet. |
| onRemoteSubscribeFallbackToAudioOnly | Callback triggered when the remote media stream switches between audio and video due to network changes. |
| onSendAudioPacket | Callback triggered when the local user sends an audio packet. |
| onSendVideoPacket | Callback triggered when the local user sends a video packet. |
| onUplinkNetworkInfoUpdated | Callback triggered when uplink network information changes. |