Package io.agora.rtc2

Class RtcEngine

java.lang.Object
io.agora.rtc2.RtcEngine
Direct Known Subclasses:
RtcEngineEx

public abstract class RtcEngine extends Object
Main interface class of the Agora Native SDK. Call the methods of this class to use all the functionalities of the SDK. Agora recommends calling the 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 Details

    • RtcEngine

      public RtcEngine()
  • Method Details

    • create

      public static RtcEngine create(Context context, String appId, IRtcEngineEventHandler handler) throws Exception
      Creates an RtcEngine instance. Unless otherwise specified, all the methods provided by the RtcEngine class 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 one RtcEngine instance. To change your App ID, call destroy to destroy the current RtcEngine instance and then call `create` to create an RtcEngine instance with the new App ID.
      handler - IRtcEngineEventHandler is an abstract class providing default implementation. The SDK uses this class to report to the app on SDK runtime events.
      Returns:
      - The RtcEngine instance, if the method call succeeds. - < 0, if the method call fails.
      Throws:
      Exception - Fails to create an RtcEngine instance.
    • create

      public static RtcEngine create(RtcEngineConfig config) throws Exception
      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, see RtcEngineConfig.
      Returns:
      An RtcEngine object.
      Throws:
      Exception - Fails to create an RtcEngine instance.
    • destroy

      public static void destroy()
    • destroy

      public static void destroy(IRtcEngineReleaseCallback callback)
      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. The RtcEngine differentiates channel profiles and applies different optimization algorithms accordingly. For example, it prioritizes smoothness and low latency for a video call, and prioritizes video quality for a video broadcast.
      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

      public abstract int setClientRole(int role, ClientRoleOptions options)
      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: onUserJoined or onUserOffline(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

      public abstract int preloadChannel(String token, String channelName, int optionalUid)
      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

      public abstract int updatePreloadChannelToken(String token)
      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

      public abstract int joinChannel(String token, String channelId, String optionalInfo, int uid)
      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 the leaveChannel method 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 the leaveChannel method 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 the onJoinChannelSuccess callback. Your app must record and maintain the returned value as the SDK does not maintain it.
      options - The channel media options: ChannelMediaOptions.
      Returns:
      - 0: Success. - < 0: Failure.
    • registerLocalUserAccount

      public abstract int registerLocalUserAccount(String appId, String userAccount)
      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: onLocalUserRegistered and onJoinChannelSuccess. - The remote client: onUserJoined and onUserInfoUpdated, if the user joining the channel is in the `COMMUNICATION` profile, or is a host in the `LIVE_BROADCASTING` profile.
    • getUserInfoByUserAccount

      public abstract int getUserInfoByUserAccount(String userAccount, UserInfo userInfo)
      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

      public abstract int getUserInfoByUid(int uid, UserInfo userInfo)
      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 the onLeaveChannel callback.
      Returns:
      - 0: Success. - < 0: Failure.
    • leaveChannel

      public abstract int leaveChannel(LeaveChannelOptions options)
      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

      public abstract int renewToken(String token)
      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. - The onTokenPrivilegeWillExpire callback is triggered; - The onRequestToken callback is triggered; - The `ERR_TOKEN_EXPIRED(-109)` error is reported.
      Parameters:
      token - The new token.
      Returns:
      - 0: Success. - < 0: Failure.
    • getAudioDeviceInfo

      public abstract DeviceInfo 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. See AudioProfile.
      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. See AudioProfile.
      scenario - Sets the audio application scenarios. See AudioScenario.
      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 the onAudioVolumeIndication callback is enabled, the SDK returns the volume indication in the at the time interval set in `enableAudioVolumeIndication`, regardless of whether any user is speaking in the channel.
      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, call enableLocalVideo (true).
      Returns:
      - 0: Success. - < 0: Failure.
    • setVideoEncoderConfiguration

      public abstract int setVideoEncoderConfiguration(VideoEncoderConfiguration config)
      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

      public abstract CodecCapInfo[] 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

      public abstract AgoraFocalLengthInfo[] queryCameraFocalLengthCapability()
      Query all focal attributes supported by the camera.
      Returns:
      - AgoraFocalLengthInfo: The camera supports the collection of focal segments.
    • setCameraCapturerConfiguration

      public abstract int setCameraCapturerConfiguration(CameraCapturerConfiguration config)
      Sets the camera capturer configuration.
      Parameters:
      config - The camera capturer configuration. For details, see CameraCapturerConfiguration.
      Returns:
      - 0: Success. - < 0: Failure.
    • setupLocalVideo

      public abstract int setupLocalVideo(VideoCanvas local)
      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

      public abstract int setupRemoteVideo(VideoCanvas remote)
      Initializes the video view of a remote user. This method initializes the video view of a remote stream on the local device. It affects only the video view that the local user sees. Usually the app should specify the `uid` of the remote video in the method call before the remote user joins the channel. If the remote `uid` is unknown to the app, set it later when the app receives the onUserJoined callback. To unbind the remote user from the view, set `view` in VideoCanvas as `null`.
      Parameters:
      remote - The remote video view settings: VideoCanvas.
      Returns:
      - 0: Success. - < 0: Failure.
    • setRemoteRenderMode

      @Deprecated public abstract int setRemoteRenderMode(int uid, int renderMode)
      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 public abstract int setLocalRenderMode(int renderMode)
      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 calling leaveChannel, the local video preview remains until you call stopPreview to disable it.
      Returns:
    • startPreview

      public abstract int startPreview(Constants.VideoSourceType sourceType)
      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

      public abstract int stopPreview(Constants.VideoSourceType sourceType)
      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 using enableVideo, the local video is enabled by default. This method disables or re-enables the local video capture. `enableLocalVideo(false)` applies to scenarios when the user wants to watch the remote video without sending any video stream to the other user.
      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

      public abstract int stopCameraCapture(Constants.VideoSourceType sourceType)
      Stops video capture with a specified camera.
      Parameters:
      sourceType - - The video source type.
    • startLocalVideoTranscoder

      public abstract int startLocalVideoTranscoder(LocalTranscoderConfiguration config)
      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

      public abstract int updateLocalTranscoderConfiguration(LocalTranscoderConfiguration config)
      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

      public abstract int startLocalAudioMixer(LocalAudioMixerConfiguration config)
      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

      public abstract int updateLocalAudioMixerConfiguration(LocalAudioMixerConfiguration config)
      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

      public abstract int setBeautyEffectOptions(boolean enabled, BeautyOptions options)
      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. See BeautyOptions.
      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. See BeautyOptions.
      sourceType - The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. See Constants#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

      public abstract int setFaceShapeBeautyOptions(boolean enabled, FaceShapeBeautyOptions options)
      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. See FaceShapeBeautyOptions.
      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. See FaceShapeBeautyOptions.
      sourceType - The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. See Constants#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

      public abstract FaceShapeBeautyOptions 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. See Constants#MediaSourceType.
      Returns:
      FaceShapeBeautyOptions
    • setFaceShapeAreaOptions

      public abstract int setFaceShapeAreaOptions(FaceShapeAreaOptions options)
      Sets the face shape area options.
      Parameters:
      options - The face shape area options. See FaceShapeAreaOptions.
      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. See FaceShapeAreaOptions.
      sourceType - The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. See Constants#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

      public abstract FaceShapeAreaOptions getFaceShapeAreaOptions(int shapeArea)
      Gets the face shape area options.
      Parameters:
      shapeArea - The face shape area. See FaceShapeAreaOptions.
      Returns:
      FaceShapeAreaOptions
    • getFaceShapeAreaOptions

      public abstract FaceShapeAreaOptions getFaceShapeAreaOptions(int shapeArea, Constants.MediaSourceType sourceType)
      Gets the face shape area options.
      Parameters:
      shapeArea - The face shape area. See FaceShapeAreaOptions.
      sourceType - The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. See Constants#MediaSourceType.
      Returns:
      FaceShapeAreaOptions
    • setFilterEffectOptions

      public abstract int setFilterEffectOptions(boolean enabled, FilterEffectOptions options)
      Sets filter effect option.
      Parameters:
      enabled - Whether to enable filter beauty: - `true`: Enabled. - `false`: (Default) Disabled.
      options - The filter effect options. See FilterEffectOptions.
      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. See FilterEffectOptions.
      sourceType - The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. See Constants#MediaSourceType.
      Returns:
      - 0: Success. - < 0: Failure.
      Since:
      v4.4.1.
    • setLowlightEnhanceOptions

      public abstract int setLowlightEnhanceOptions(boolean enabled, LowLightEnhanceOptions options)
      Sets low-light enhancement.
      Parameters:
      enabled - Sets whether to enable low-light enhancement: - `true`: Enable. - `false`: (Default) Disable.
      options - The low-light enhancement options. See LowLightEnhanceOptions.
      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. See LowLightEnhanceOptions.
      sourceType - The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. See Constants#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

      public abstract int setVideoDenoiserOptions(boolean enabled, VideoDenoiserOptions options)
      Sets video noise reduction.
      Parameters:
      enabled - Sets whether to enable video noise reduction: - `true`: Enable. - `false`: (Default) Disable.
      options - The video noise reduction options. See VideoDenoiserOptions.
      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. See VideoDenoiserOptions.
      sourceType - The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. See Constants#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

      public abstract int setColorEnhanceOptions(boolean enabled, ColorEnhanceOptions options)
      Sets color enhancement.
      Parameters:
      enabled - Sets whether to enable color enhancement: - `true`: Enable. - `false`: (Default) Disable.
      options - The color enhancement options. See ColorEnhanceOptions.
      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. See ColorEnhanceOptions.
      sourceType - The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. See Constants#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. See Constants#MediaSourceType.
      Returns:
      - IVideoEffectObject: Success. - null: Failure.
      Since:
      v4.6.0
    • destroyVideoEffectObject

      public abstract int destroyVideoEffectObject(IVideoEffectObject videoEffectObject)
      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. See VirtualBackgroundSource.
      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. See VirtualBackgroundSource.
      SegmentationProperty -
      sourceType - The source type of the extension, e.g. PRIMARY_CAMERA_SOURCE. See Constants#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 the onAudioRouteChanged callback.
      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 the onAudioRouteChanged callback. You can call this method before, during, or after a call. However, Agora recommends calling this method only when you are in a channel to change the audio route temporarily.
      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_FREQUENCY
      bandGain - Gain of each band in dB; ranging from -15 to 15.
    • setLocalVoiceReverb

      public abstract int setLocalVoiceReverb(Constants.AUDIO_REVERB_TYPE reverbKey, int value)
      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 setAudioProfile and 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 setAudioProfile and setting the `scenario` parameter to `AUDIO_SCENARIO_GAME_STREAMING(3)` and the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before calling this method.
    • 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 setAudioProfile and setting the `scenario` parameter to `AUDIO_SCENARIO_GAME_STREAMING(3)` and the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before calling this method.
    • 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

      public abstract int enableVoiceAITuner(boolean enabled, Constants.VOICE_AI_TUNER_TYPE type)
      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

      public abstract int startAudioMixing(String filePath, boolean loopback, int cycle)
      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 the onAudioMixingStateChanged(AUDIO_MIXING_STATE_PLAYING) callback on the local client. When the audio mixing file playback finishes, the SDK triggers the onAudioMixingStateChanged(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

      public abstract int setRemoteUserSpatialAudioParams(int uid, SpatialAudioParams params)
    • setRemoteVideoSubscriptionOptions

      public abstract int setRemoteVideoSubscriptionOptions(int uid, VideoSubscriptionOptions options)
    • 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

      public abstract int startAudioMixing(String filePath, boolean loopback, int cycle, int startPos)
      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 the onAudioMixingStateChanged(AUDIO_MIXING_STATE_PLAYING) callback on the local client. When the audio mixing file playback finishes, the SDK triggers the onAudioMixingStateChanged(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

      public abstract int setAudioMixingDualMonoMode(Constants.AudioMixingDualMonoMode mode)
      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

      public abstract IAudioEffectManager getAudioEffectManager()
      Gets the IAudioEffectManager object associated with the current RTC engine.
      Returns:
      IAudioEffectManager
    • startAudioRecording

      public abstract int startAudioRecording(String filePath, int quality)

      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 joinChannel method. The recording automatically stops when the leaveChannel method 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 joinChannel method. The recording automatically stops when the leaveChannel method 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 the leaveChannel method is called.

      Returns:
      • 0: Success.
      • <0: Failure.
    • startEchoTest

      public abstract int startEchoTest(EchoTestConfiguration config)
      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 the onLastmileProbeResult callback 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, see LastmileProbeConfig.
      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

      public abstract int setExternalRemoteEglContext(Object eglContext)
      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 the setExternalAudioSink(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 in setExternalAudioSink. 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

      public abstract int pullPlaybackAudioFrame(ByteBuffer data, int lengthInByte)
      Pulls the remote audio frame. Before calling this method, call the setExternalAudioSink(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 in setExternalAudioSink. 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

      public abstract int startPlaybackDeviceTest(String audioFileName)
      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 track
      config - 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 playback
      publish - 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 public abstract int pushExternalAudioFrame(byte[] data, long timestamp)
      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 sample
      trackId - 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 sample
      trackId - 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 public abstract boolean pushExternalVideoFrame(VideoFrame frame)
      Deprecated.
      This method is deprecated. Call the setExternalVideoSource method 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. See VideoFrame: - `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

      public abstract int registerAudioFrameObserver(IAudioFrameObserver observer)
      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 the onRecordAudioFrame callback.
      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 the onPlaybackAudioFrame callback.
      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 the onMixedAudioFrame callback.
      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 the onEarMonitoringAudioFrame callback.
      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 public abstract int addVideoWatermark(AgoraImage watermark)
      Deprecated.
      From v2.9.1. We recommend using the addVideoWatermark2 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 the setLiveTranscoding method.
      Adds a watermark image to the local video.
      Parameters:
      watermark - Watermark image to be added to the local video stream. See Agora Image.
      Returns:
      - 0: Success. - < 0: Failure.
    • addVideoWatermark

      @Deprecated public abstract int addVideoWatermark(String watermarkUrl, WatermarkOptions options)
      Deprecated.
      From v4.6.0. We recommend using the addVideoWatermark2 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 the setVideoEncoderConfiguration method: - 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. See Watermark Options.
      Returns:
      - 0: Success. - < 0: Failure.
      Since:
      v2.9.1 to replace addVideoWatermark1.
    • addVideoWatermark

      public abstract int addVideoWatermark(WatermarkConfig config)
      Parameters:
      config - The watermark configuration. See WatermarkConfig.
      Returns:
      - 0: Success. - < 0: Failure.
      Since:
      v4.6.0
    • removeVideoWatermark

      public abstract int removeVideoWatermark(String id)
      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 by addVideoWatermark.
      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:
      Returns:
      • 0: Success.
      • <0: Failure.
      Since:
      v2.4.0.

      Use this method with the setRemoteSubscribeFallbackOption method. If the fallback function is enabled for a subscribed stream, the SDK ensures the high-priority user gets the best possible stream quality.

    • setRemoteSubscribeFallbackOption

      public abstract int setRemoteSubscribeFallbackOption(Constants.StreamFallbackOptions option)
      Sets the fallback option for the remotely subscribed video stream based on the network conditions. If @p option is set as STREAM_FALLBACK_OPTION_AUDIO_ONLY(2), the SDK automatically switches the video from a high-stream to a low-stream, or disables the video when the downlink network 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 the onRemoteSubscribeFallbackToAudioOnly callback. 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 public abstract int setRemoteSubscribeFallbackOption(int option)
      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 public abstract int enableDualStreamMode(boolean enabled)
      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 using setRemoteVideoStreamType.
      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 using setRemoteVideoStreamType.
      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

      public abstract int setDualStreamMode(Constants.SimulcastStreamMode mode)
      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 using setRemoteVideoStreamType.
      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 using setRemoteVideoStreamType.
      Parameters:
      mode - - The dual-stream mode
      streamConfig - - The minor stream config
    • setSimulcastConfig

      public abstract int setSimulcastConfig(SimulcastConfig simulcastConfig)
      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 using setRemoteVideoStreamType.
      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

      public abstract int setLocalRenderTargetFps(Constants.VideoSourceType sourceType, int targetFps)
      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

      public abstract int setRemoteVideoStreamType(int uid, Constants.VideoStreamType streamType)
      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 public abstract int setRemoteVideoStreamType(int uid, int streamType)
      Deprecated.
    • setRemoteDefaultVideoStreamType

      public abstract int setRemoteDefaultVideoStreamType(Constants.VideoStreamType streamType)
      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 public abstract int setRemoteDefaultVideoStreamType(int streamType)
      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. See EncryptionConfig.
      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

      public abstract int startRtmpStreamWithoutTranscoding(String url)
      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

      public abstract int startRtmpStreamWithTranscoding(String url, LiveTranscoding transcoding)
      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

      public abstract int updateRtmpTranscoding(LiveTranscoding transcoding)
      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

      public abstract int stopRtmpStream(String url)
      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

      public abstract int createDataStream(DataStreamConfig config)
      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 indicates ERR_INVALID_ARGUMENT(-2) in Error 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 the onStreamMessage callback on the remote client. After the remote user does not receive the data stream within 5 seconds, the SDK triggers the onStreamMessageError callback.
      Parameters:
      streamId - ID of the sent data stream returned by the createDataStream method.
      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 public abstract int setLocalVideoMirrorMode(int mode)
      Deprecated.
      Sets the local video mirror mode. Use this method before calling the startPreview method, or the mirror mode does not take effect until you call the `startPreview` method again.
      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 public static int getRecommendedEncoderType()
      Deprecated.
      This method is deprecated.
      Gets the recommended encoder type.
      Returns:
      The encoder type:
    • switchCamera

      public abstract int switchCamera()
      Switches between front and rear cameras.
      Returns:
      - 0: Success. - < 0: Failure.
    • switchCamera

      public abstract int switchCamera(String cameraId)
      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

    public abstract int setCameraZoomFactor(float factor)
    Sets the camera zoom ratio.
    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

    public abstract float getCameraMaxZoomFactor()
    Gets the maximum zoom ratio supported by the camera.
    Returns:
    The maximum zoom ratio supported by the camera.
  • setCameraFocusPositionInPreview

    public abstract int setCameraFocusPositionInPreview(float positionX, float positionY)
    Sets the manual focus position.
    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

    public abstract int setCameraExposurePosition(float positionXinView, float positionYinView)
    Sets the camera exposure position. Ensure that you call this method after the camera starts, for example, by calling `startPreview` or `joinChannel`. A successful setCameraExposurePosition method call triggers the onCameraExposureAreaChanged callback on the local client.
    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

    public abstract int enableFaceDetection(boolean enabled)
    Enables the camera face detect.
    Parameters:
    enabled - Determines whether to enable the camera face detect. - true: Enable the face detect. - false: Do not enable the face detect.
  • setCameraTorchOn

    public abstract int setCameraTorchOn(boolean isOn)
    Enables the camera flash.
    Parameters:
    isOn - Determines whether to enable the camera flash. - true: Enable the flash. - false: Do not enable the flash.
  • setCameraAutoFocusFaceModeEnabled

    public abstract int setCameraAutoFocusFaceModeEnabled(boolean enabled)
    Enables the camera auto focus face function.
    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

    public abstract int setCameraExposureFactor(int factor)
    Sets the camera exposure ratio.
    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

    public abstract String getCallId()
    Gets the current call ID. When a user joins a channel on a client, a `callId` is generated to identify the call. After a call ends, you can call `rate` or `complain` to gather feedback from the customer. These methods require a `callId` parameter. To use these feedback methods, call the this method first to retrieve the `callId` during the call, and then pass the value as an argument in the `rate` or `complain` method after the call ends.
    Returns:
    - The call ID if the method call is successful. - < 0: Failure.
  • rate

    public abstract int rate(String callId, int rating, String description)
    Allows a user to rate the call. It is usually called after the call ends.
    Parameters:
    callId - The call ID retrieved from the getCallId method.
    rating - The rating of the call between 1 (the lowest score) to 5 (the highest score).
    description - (Optional) The description of the rating. The string length must be less than 800 bytes.
    Returns:
    - 0: Success. - < 0: Failure.
  • complain

    public abstract int complain(String callId, String description)
    Allows a user to complain about the call quality. This method is usually called after the call ends.
    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

    public static String getSdkVersion()
    Gets the SDK version.
    Returns:
    The version of the current SDK in the string format.
  • getMediaEngineVersion

    @Deprecated public static String getMediaEngineVersion()
    Deprecated.
    Returns the media engine version.
    Returns:
    The string of the version number in char format.
  • setLogFile

    public abstract int setLogFile(String filePath)
    Specifies an SDK output log file. The log file records all log data for the SDK’s operation. Ensure that the directory for the log file exists and is writable.
    Parameters:
    filePath - File path of the log file. The string of the log file is in UTF-8.
    Returns:
    - 0: Success. - < 0: Failure.
  • setLogFilter

    public abstract int setLogFilter(int filter)
    Sets the output log filter level of the SDK. You can use one or a combination of the filters. The log level follows the sequence of `OFF`, `CRITICAL`, `ERROR`, `WARNING`, `INFO`, and `DEBUG`. Choose a level and you will see logs preceding that level. For example, if you set the log level to `WARNING`, you see the logs within levels `CRITICAL`, `ERROR`, and `WARNING`.
    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

    public abstract int setLogLevel(int level)
    Sets the output log level of the SDK. You can use one of the level defined in LogLevel.
    Parameters:
    level - Sets the log level: LogLevel.
    Returns:
    - 0: Success. - < 0: Failure.
  • setLogFileSize

    public abstract int setLogFileSize(long fileSizeInKBytes)
    Sets the log file size (KB). The SDK has two log files, each with a default size of 512 KB. If you set `fileSizeInBytes` as 1024 KB, the SDK outputs log files with a total maximum size of 2 MB. If the total size of the log files exceed the set value, the new output log files overwrite the old output log files.
    Parameters:
    fileSizeInKBytes - The SDK log file size (KB).
    Returns:
    - 0: Success. - < 0: Failure.
  • uploadLogFile

    public abstract String uploadLogFile()
    Upload current log file immediately to server. only use this when an error occurs block before log file upload success or timeout.
    Returns:
    - 0: Success. - < 0: Failure.
  • writeLog

    public abstract int writeLog(int level, String format, Object... args)
    Write the log to SDK . @technical preview You can use one of the level defined in LogLevel.
    Parameters:
    level - Sets the log level: LogLevel.
    Returns:
    - 0: Success. - < 0: Failure.
  • getNativeHandle

    public abstract long 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

    public void addHandler(IRtcEngineEventHandler handler)
    Adds the IRtcEngineEventHandler.
    Parameters:
    handler - The IRtcEngineEventHandler instance.
  • removeHandler

    public void removeHandler(IRtcEngineEventHandler handler)
    Removes the specified IRtcEngineEventHandler object. For callback events that you only want to listen for once, call this method to remove subsequent IRtcEngineEventHandler objects after you have received them. This interface is used to remove the specific IRtcEngineEventHandler interface class instance.
    Parameters:
    handler - The IRtcEngineEventHandler object.
  • enableHighPerfWifiMode

    @Deprecated public abstract boolean enableHighPerfWifiMode(boolean enable)
    Deprecated.
    This method is deprecated.
    Enables the Wi-Fi mode.
    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

    public abstract long getNativeMediaPlayer(int sourceId)

    Returns the native handler of the mediaplayer.

  • getErrorDescription

    public static String getErrorDescription(int error)
    Gets the warning or error description.
    Parameters:
    error - The warning or error code.
    Returns:
    The detailed warning or error description.
  • queryHDRCapability

    public abstract int queryHDRCapability(Constants.VIDEO_MODULE_TYPE moduleType)
    Queries the HDR capability of the video module.
    Returns:
    - 0: Unsupported. - 1: Supported. - < 0: Unknown.
    Since:
    v4.6.0
  • queryScreenCaptureCapability

    public abstract int queryScreenCaptureCapability()
    Queries the ability of screen sharing to support the minimum frame rate.
    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

    @Deprecated public abstract void monitorHeadsetEvent(boolean monitor)
    Deprecated.
    Monitors external headset device events.
    Parameters:
    monitor - Whether to enable monitoring external headset device events. True/False.
  • monitorBluetoothHeadsetEvent

    @Deprecated public abstract void monitorBluetoothHeadsetEvent(boolean monitor)
    Deprecated.
    Monitors Bluetooth headset device events.
    Parameters:
    monitor - Whether to enable monitoring Bluetooth headset device events. True/False.
  • setPreferHeadset

    @Deprecated public abstract void setPreferHeadset(boolean enabled)
    Deprecated.
    This method is deprecated.
    Sets the default audio route to the headset.
    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

    public abstract int setParameters(String parameters)

    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

    public abstract String getParameters(String parameters)
    Queries internal states
    Parameters:
    parameters - JSON string
    Returns:
    A JSON string
  • getParameter

    public abstract String getParameter(String parameter, String args)
    Gets the Agora SDK’s parameters for customization purposes. This method is not disclosed yet. Contact support@agora.io for more information.
  • registerMediaMetadataObserver

    public abstract int registerMediaMetadataObserver(IMetadataObserver observer, int type)
    Registers the metadata observer. You need to implement the IMetadataObserver class and specify the metadata type in this method. This method enables you to add synchronized metadata in the video stream for more diversified live interactive streaming, such as sending shopping links, digital coupons, and online quizzes. A successful call of this method triggers the getMaxMetadataSize callback.
    Parameters:
    observer - The IMetadataObserver class.
    type - The metadata type. Currently, the SDK supports VIDEO_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

    public abstract int unregisterMediaMetadataObserver(IMetadataObserver observer, int type)
    Unregisters the metadata observer.
    Parameters:
    observer - The IMetadataObserver class.
    type - The metadata type. Currently, the SDK supports VIDEO_METADATA(0) only.
    Returns:
    - 0: Success. - < 0: Failure.
  • startOrUpdateChannelMediaRelay

    public abstract int startOrUpdateChannelMediaRelay(ChannelMediaRelayConfiguration channelMediaRelayConfiguration)
    Starts or update to relay media streams across channels. After a successful method call, the SDK triggers the 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. See ChannelMediaRelayConfiguration.
    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

    public abstract int stopChannelMediaRelay()
    Stops the media stream relay. Once the relay stops, the broadcaster quits all the destination channels. After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged callback. If the callback returns `RELAY_STATE_IDLE(0)` and `RELAY_OK(0)`, the broadcaster successfully stops the relay.
    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

    public abstract int pauseAllChannelMediaRelay()
    pause the channels for media stream 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.
  • resumeAllChannelMediaRelay

    public abstract int resumeAllChannelMediaRelay()
    resume the channels for media stream 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.
  • updateChannelMediaOptions

    public abstract int updateChannelMediaOptions(ChannelMediaOptions options)
    Updates the channel media options after joining the channel.
    Parameters:
    options - The channel media options: ChannelMediaOptions.
    Returns:
    - 0: Success. - < 0: Failure.
  • muteRecordingSignal

    public abstract int muteRecordingSignal(boolean muted)
    Mute or resume recording signal volume.
    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

    public abstract int setPlaybackAudioFrameBeforeMixingParameters(int sampleRate, int channel)
    Sets the audio playback format before mixing for the 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

    public abstract int setPlaybackAudioFrameBeforeMixingParameters(int sampleRate, int channel, int samplesPerCall)
    Sets the audio playback format before mixing for the 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
    samplesPerCall - Sets the number of samples the `onMixedAudioFrame` callback returns. In RTMP streaming scenarios, set it as 1024.
    Returns:
    - 0: Success. - < 0: Failure.
  • enableAudioSpectrumMonitor

    public abstract int enableAudioSpectrumMonitor(int intervalInMS)
    Enable the audio spectrum monitor.
    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

    public abstract int disableAudioSpectrumMonitor()
    Disalbe the audio spectrum monitor.
    Returns:
    - 0: Success. - < 0: Failure.
  • registerAudioSpectrumObserver

    public abstract int registerAudioSpectrumObserver(IAudioSpectrumObserver observer)
    Registers an audio spectrum observer. You need to implement the `IAudioSpectrumObserver` class in this method, and register the following callbacks according to your scenario: - \ref agora::media::IAudioSpectrumObserver::onAudioSpectrumComputed "onAudioSpectrumComputed": Occurs when the SDK receives the audio data and at set intervals.
    Parameters:
    observer - A pointer to the audio spectrum observer: \ref agora::media::IAudioSpectrumObserver "IAudioSpectrumObserver".
    Returns:
    - 0: Success. - < 0: Failure.
  • unRegisterAudioSpectrumObserver

    public abstract int unRegisterAudioSpectrumObserver(IAudioSpectrumObserver observer)
    Releases the audio spectrum observer.
    Parameters:
    observer - The pointer to the audio spectrum observer: \ref agora::media::IAudioSpectrumObserver "IAudioSpectrumObserver".
    Returns:
    - 0: Success. - < 0: Failure.
  • getEffectsVolume

    public abstract double getEffectsVolume()
    Gets the volume of the audio effects.
    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

    public abstract int setEffectsVolume(double volume)
    Sets the volume of audio effects.
    Parameters:
    volume - The volume of audio effects. The value ranges between 0.0 and 100.0 (default).
    Returns:
    - 0: Success. - < 0: Failure.
  • preloadEffect

    public abstract int preloadEffect(int soundId, String filePath)
    Preloads a specified audio effect. This method preloads only one specified audio effect into the memory each time it is called. To preload multiple audio effects, call this method multiple times. After preloading, you can call {@link RtcEngine#playEffect() playEffect} to play the preloaded audio effect or call {@link RtcEngine#playAllEffects() playAllEffects} to play all the preloaded audio effects.
    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

    public abstract int preloadEffect(int soundId, String filePath, int startPos)
    Preloads a specified audio effect. This method preloads only one specified audio effect into the memory each time it is called. To preload multiple audio effects, call this method multiple times. After preloading, you can call {@link RtcEngine#playEffect() playEffect} to play the preloaded audio effect or call {@link RtcEngine#playAllEffects() playAllEffects} to play all the preloaded audio effects.
    Parameters:
    soundId - The ID of the audio effect.
    filePath - The absolute path of the local audio effect file or the URL
    startPos - 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

    public abstract int playEffect(int soundId, String filePath, int loopCount, double pitch, double pan, double gain, boolean publish)
    Plays a specified audio effect. After calling preloadEffect, you can call this method to play the specified audio effect for all users in the channel. This method plays only one specified audio effect each time it is called. To play multiple audio effects, call this method multiple times.
    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 call stopEffect or stopAllEffects. - `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

    public abstract int playEffect(int soundId, String filePath, int loopCount, double pitch, double pan, double gain, boolean publish, int startPos)
    Plays a specified audio effect. After calling preloadEffect, you can call this method to play the specified audio effect for all users in the channel. This method plays only one specified audio effect each time it is called. To play multiple audio effects, call this method multiple times.
    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 call stopEffect or stopAllEffects. - `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

    public abstract int playAllEffects(int loopCount, double pitch, double pan, double gain, boolean publish)
    Plays all audio effects. After calling preloadEffect multiple times to preload multiple audio effects into the memory, you can call this method to play all the specified audio effects for all users in the channel.
    Parameters:
    loopCount - The number of times the audio effect loops: - `-1`: Play the audio effect in an indefinite loop until you call stopEffect or stopAllEffects. - `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

    public abstract int getVolumeOfEffect(int soundId)
    Get the volume of a specified sound effect.
    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

    public abstract int setVolumeOfEffect(int soundId, double volume)
    Sets the volume of the specified audio effect.
    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

    public abstract int pauseEffect(int soundId)
    Pauses playing the specified audio effect.
    Parameters:
    soundId - The ID of the audio effect.
    Returns:
    - 0: Success. - < 0: Failure.
  • pauseAllEffects

    public abstract int pauseAllEffects()
    Pauses playing all audio effects.
    Returns:
    - 0: Success. - < 0: Failure.
  • resumeEffect

    public abstract int resumeEffect(int soundId)
    Resumes playing the specified audio effect.
    Parameters:
    soundId - The ID of the audio effect.
    Returns:
    - 0: Success. - < 0: Failure.
  • resumeAllEffects

    public abstract int resumeAllEffects()
    Resumes playing all audio effects.
    Returns:
    - 0: Success. - < 0: Failure.
  • stopEffect

    public abstract int stopEffect(int soundId)
    Stops playing the specified audio effect.
    Parameters:
    soundId - The ID of the audio effect.
    Returns:
    - 0: Success. - < 0: Failure.
  • stopAllEffects

    public abstract int stopAllEffects()
    Stops playing all audio effects.
    Returns:
    - 0: Success. - < 0: Failure.
  • unloadEffect

    public abstract int unloadEffect(int soundId)
    Releases the specific preloaded audio effect from the memory.
    Parameters:
    soundId - The ID of the audio effect.
    Returns:
    - 0: Success. - < 0: Failure.
  • unloadAllEffects

    public abstract int unloadAllEffects()
    Releases all preloaded audio effects from the memory.
    Returns:
    - 0: Success. - < 0: Failure.
  • getEffectDuration

    public abstract int getEffectDuration(String filePath)
    Gets the duration of the audio effect file.
    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

    public abstract int setEffectPosition(int soundId, int pos)
    Sets the playback position of an audio effect file. After a successful setting, the local audio effect file starts playing at the specified position.
    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

    public abstract int getEffectCurrentPosition(int soundId)
    Gets the playback position of the audio effect file.
    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

    public abstract int registerVideoEncodedFrameObserver(IVideoEncodedFrameObserver receiver)
    Registers a receiver object for the encoded video image.
    Parameters:
    receiver - The IVideoEncodedFrameObserver object: IVideoEncodedFrameObserver.
    Returns:
    - 0: Success. - < 0: Failure.
  • registerFaceInfoObserver

    public abstract int registerFaceInfoObserver(IFaceInfoObserver receiver)
    Registers an face info observer object.
    Parameters:
    observer - A pointer to the face info observer object: IFaceInfoObserver.
    Returns:
    - 0: Success. - < 0: Failure.
  • takeSnapshot

    public abstract int takeSnapshot(int uid, String filePath)
    Takes a snapshot of a video stream. This method takes a snapshot of a video stream from the specified user, generates a JPG image, and saves it to the specified path. The method is asynchronous, and the SDK has not taken the snapshot when the method call returns. After a successful method call, the SDK triggers the `onSnapshotTaken` callback to report whether the snapshot is successfully taken, as well as the details for that snapshot.
    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

    public abstract int takeSnapshot(int uid, SnapshotConfig config)
    Takes a snapshot of a video stream. This method takes a snapshot of a video stream from the specified user, generates a JPG image, and saves it to the specified path. The method is asynchronous, and the SDK has not taken the snapshot when the method call returns. After a successful method call, the SDK triggers the `onSnapshotTaken` callback to report whether the snapshot is successfully taken, as well as the details for that snapshot.
    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

    public abstract int enableContentInspect(boolean enabled, ContentInspectConfig config)
  • loadExtensionProvider

    public abstract int loadExtensionProvider(String path)
  • registerExtension

    public abstract int registerExtension(String provider, String extension, Constants.MediaSourceType sourceType)
    Registers an extension. Normally, you should call this function immediately after initializing the engine. Once an extension is registered, the SDK will automatically create and add it to the pipeline.
    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. See Constants#MediaSourceType.
    Returns:
    - 0: Success. - < 0: Failure.
  • enableExtension

    public abstract int enableExtension(String provider, String extension, boolean enable)
    Enable/Disable an extension. By calling this function, you can dynamically enable/disable the extension without changing the pipeline. For example, enabling/disabling Extension_A means the data will be adapted/bypassed by Extension_A. NOTE: For compatibility reasons, if you haven't call registerExtension, enableExtension will automatically register the specified extension. We suggest you call registerExtension explicitly.
    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

    public abstract int enableExtension(String provider, String extension, boolean enable, Constants.MediaSourceType sourceType)
    Enable/Disable an extension. By calling this function, you can dynamically enable/disable the extension without changing the pipeline. For example, enabling/disabling Extension_A means the data will be adapted/bypassed by Extension_A. NOTE: For compatibility reasons, if you haven't call registerExtension, enableExtension will automatically register the specified extension. We suggest you call registerExtension explicitly.
    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. See Constants#MediaSourceType.
    Returns:
    - 0: Success. - < 0: Failure.
  • setExtensionProperty

    public abstract int setExtensionProperty(String provider, String extension, String key, String value)
    Sets the properties of an extension.
    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

    public abstract int setExtensionProperty(String provider, String extension, String key, String value, Constants.MediaSourceType sourceType)
    Sets the properties of an extension.
    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. See Constants#MediaSourceType.
    Returns:
    true, if get property success, otherwise false
  • getExtensionProperty

    public abstract String getExtensionProperty(String provider, String extension, String key)
    Gets the properties of an extension.
    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

    public abstract String getExtensionProperty(String provider, String extension, String key, Constants.MediaSourceType sourceType)
    Gets the properties of an extension.
    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. See Constants#MediaSourceType.
    Returns:
    JSON formatted string of property's value; return null if failed
  • setExtensionProviderProperty

    public abstract int setExtensionProviderProperty(String provider, String key, String value)
    Sets the provider property of an extension.
    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

    public abstract int enableExtension(String provider, String extension, ExtensionInfo extensionInfo, boolean enable)
    Enable/Disable an extension. By calling this function, you can dynamically enable/disable the extension without changing the pipeline. For example, enabling/disabling Extension_A means the data will be adapted/bypassed by Extension_A. NOTE: For compatibility reasons, if you haven't call registerExtension, enableExtension will automatically register the specified extension. We suggest you call registerExtension explicitly.
    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. See ExtensionInfo.
    enable - Whether to enable the extension: - true: (Default) Enable the extension. - false: Disable the extension.
    Returns:
    - 0: Success. - < 0: Failure.
  • setExtensionProperty

    public abstract int setExtensionProperty(String provider, String extension, ExtensionInfo extensionInfo, String key, String value)
    Sets the properties of an extension.
    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. See ExtensionInfo.
    key - The key of the extension.
    value - The JSON formatted value of the extension key.
    Returns:
    - 0: Success. - < 0: Failure.
  • getExtensionProperty

    public abstract String getExtensionProperty(String provider, String extension, ExtensionInfo extensionInfo, String key)
    Gets the properties of an extension.
    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. See ExtensionInfo.
    key - The key of the extension.
    Returns:
    JSON formatted string of property's value; return null if failed
  • startScreenCapture

    public abstract int startScreenCapture(ScreenCaptureParameters screenCaptureParameters)
    Starts screen sharing.
    Parameters:
    screenCaptureParameters - The configuration of the screen sharing. See ScreenCaptureParameters.
    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) and ERR_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 code ERR_SCREEN_CAPTURE_SYSTEM_AUDIO_NOT_SUPPORTED(3).
  • setExternalMediaProjection

    public abstract int setExternalMediaProjection(MediaProjection mediaProjection)
    Sets screen sharing using the Android native class MediaProjection. When screen scapture stopped, the SDK will automatically release the MediaProjection internally.
    Parameters:
    mediaProjection - MediaProjection is an Android class that provides access to screen capture and recording capabiliies.
    Returns:
    - 0: Success. - < 0: Failure.
  • setScreenCaptureScenario

    public abstract int setScreenCaptureScenario(Constants.ScreenScenarioType screenScenario)
    Sets the screen sharing scenario.
    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

    public abstract int stopScreenCapture()
    Stops screen sharing.
    Returns:
    - 0: Success. - < 0: Failure.
    Since:
    v3.7.0 After calling this method to stop screen sharing
  • setVideoScenario

    public abstract int setVideoScenario(Constants.VideoScenario scenarioType)
    You can call this method to set the expected video scenario. The SDK will optimize the video experience for each scenario you set.
    Parameters:
    scenarioType - The video application scenario.
    Returns:
    - 0: Success. - < 0: Failure.
  • setVideoQoEPreference

    public abstract int setVideoQoEPreference(Constants.QoEPreference qoePreference)
    Sets the video qoe preference.
    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

    public abstract int updateScreenCaptureParameters(ScreenCaptureParameters screenCaptureParameters)
    Updates the screen sharing configuration.
    Parameters:
    screenCaptureParameters - The configuration of the screen sharing. See ScreenCaptureParameters. Note: This parameter is only available for scenarios where `captureVideo` is `true`.
    Returns:
    - 0: Success. - < 0: Failure.
    Since:
    v3.7.0
  • registerVideoFrameObserver

    public abstract int registerVideoFrameObserver(IVideoFrameObserver observer)
    Registers a video frame observer object. You need to implement the 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. See IVideoFrameObserver.
    Returns:
    - 0: Success. - < 0: Failure.
  • createMediaPlayer

    public abstract IMediaPlayer createMediaPlayer()
    Create a media player You can use this function to create a ffmpeg or simple media player
    Returns:
    IMediaPlayer
  • createMediaRecorder

    public abstract AgoraMediaRecorder createMediaRecorder(RecorderStreamInfo info)
    Create a media recorder You can use this function to create a media recorder
    Parameters:
    info - The RecorderStreamInfo object. It contains user ID and channel name of user.
    Returns:
    AgoraMediaRecorder
  • destroyMediaRecorder

    public abstract void destroyMediaRecorder(AgoraMediaRecorder mediaRecorder)
    Destroy a media player source instance. This method releases the `RtcEngine` object and all other resources used by the `AgoraMediaRecorder` object. After calling this method, if you want to enable the recording again, you must call getMediaRecorder to get the `AgoraMediaRecorder` object.
    Parameters:
    mediaRecorder - The Object of \ref AgoraMediaRecorder.
  • getMediaPlayerCacheManager

    public abstract IMediaPlayerCacheManager getMediaPlayerCacheManager()
    get an MediaPlayerCacheManager instance, which is used to set and manage the player cache, implemented in the form of a singleton, independent of the player.
    Returns:
    IMediaPlayer
  • getH265Transcoder

    public abstract IH265Transcoder getH265Transcoder()
    get an H265Transcoder instance, which is used to
    Returns:
    IH265Transcoder
  • enableExternalAudioSourceLocalPlayback

    public abstract int enableExternalAudioSourceLocalPlayback(boolean enabled)
    Enable or disable the external audio source local playback. * @param enabled Determines whether to enable the external audio source local playback: - true: Enable the external audio source local playback. - false: (default) Disable the external audio source local playback.
    Returns:
    - 0: Success. - <0: Failure.
  • adjustCustomAudioPublishVolume

    public abstract int adjustCustomAudioPublishVolume(int trackId, int volume)
    Adjust the custom audio publish volume by source id.
    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

    public abstract int adjustCustomAudioPlayoutVolume(int trackId, int volume)
    Adjust the custom audio playout volume by source id.
    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

    public abstract int startRhythmPlayer(String sound1, String sound2, AgoraRhythmPlayerConfig config)
    Enables the rhythm player.
    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

    public abstract int stopRhythmPlayer()
    Disables the rhythm player.
    Returns:
    - 0: Success. - < 0: Failure.
  • configRhythmPlayer

    public abstract int configRhythmPlayer(AgoraRhythmPlayerConfig config)
    Configures the rhythm player.
    Returns:
    - 0: Success. - < 0: Failure.
  • setDirectCdnStreamingAudioConfiguration

    @Deprecated public abstract int setDirectCdnStreamingAudioConfiguration(int profile)
    Deprecated.
    v4.6.0.
    Set audio parameters for direct streaming to CDN Must call this api before "startDirectCdnStreaming"
    Parameters:
    profile - Sets the sample rate, bitrate, encoding mode, and the number of channels: #AUDIO_PROFILE_TYPE.
    Returns:
    - 0: Success. - < 0: Failure.
  • setDirectCdnStreamingVideoConfiguration

    @Deprecated public abstract int setDirectCdnStreamingVideoConfiguration(VideoEncoderConfiguration config)
    Deprecated.
    v4.6.0.
    Set video parameters for direct streaming to CDN Each configuration profile corresponds to a set of video parameters, including the resolution, frame rate, and bitrate.
    Parameters:
    config - The local video encoder configuration: VideoEncoderConfiguration.
    Returns:
    - 0: Success. - < 0: Failure.
  • getCurrentMonotonicTimeInMs

    public abstract long getCurrentMonotonicTimeInMs()
  • startDirectCdnStreaming

    @Deprecated public abstract int startDirectCdnStreaming(IDirectCdnStreamingEventHandler eventHandler, String publishUrl, DirectCdnStreamingMediaOptions options)
    Deprecated.
    v4.6.0.
    Start direct cdn streaming
    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

    @Deprecated public abstract int stopDirectCdnStreaming()
    Deprecated.
    v4.6.0.
    Stop direct cdn streaming
    Returns:
    - 0: Success. - < 0: Failure.
  • updateDirectCdnStreamingMediaOptions

    @Deprecated public abstract int updateDirectCdnStreamingMediaOptions(DirectCdnStreamingMediaOptions options)
    Deprecated.
    v4.6.0.
    Change the media source during the pushing
    Parameters:
    options - The direct cdn streaming media options: DirectCdnStreamingMediaOptions.
    Returns:
    - 0: Success. - < 0: Failure.
  • createCustomVideoTrack

    public abstract int createCustomVideoTrack()
    Get an custom video track id created by internal,which could used to publish or preview
    Returns:
    - > 0: the useable video track id. - < 0: Failure.
  • createCustomEncodedVideoTrack

    public abstract int createCustomEncodedVideoTrack(EncodedVideoTrackOptions encodedOpt)
    Get an custom encoded video track id created by internal,which could used to publish or preview
    Returns:
    - > 0: the useable video track id. - < 0: Failure.
  • destroyCustomVideoTrack

    public abstract int destroyCustomVideoTrack(int video_track_id)
    destroy a created custom video track id
    Parameters:
    video_track_id - The video track id which was created by createCustomVideoTrack
    Returns:
    - 0: Success. - < 0: Failure.
  • destroyCustomEncodedVideoTrack

    public abstract int destroyCustomEncodedVideoTrack(int video_track_id)
    destroy a created custom encoded video track id
    Parameters:
    video_track_id - The video track id which was created by createCustomEncodedVideoTrack
    Returns:
    - 0: Success. - < 0: Failure.
  • setCloudProxy

    public abstract int setCloudProxy(int proxyType)
    Sets the Agora cloud proxy service. When the user's firewall restricts the IP address and port, refer to *Use Cloud Proxy* to add the specific IP addresses and ports to the firewall whitelist; then, call this method to enable the cloud proxy and set the `proxyType` parameter as `TRANSPORT_TYPE_UDP_PROXY(1)`, which is the cloud proxy for the UDP protocol. After a successfully cloud proxy connection, the SDK triggers the 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

    public abstract int setLocalAccessPoint(LocalAccessPointConfiguration config)
    set local access point addresses in local proxy mode, use this method before join channel.
    Parameters:
    config - Configurations for local access point. For details, see LocalAccessPointConfiguration
  • enableCustomAudioLocalPlayback

    public abstract int enableCustomAudioLocalPlayback(int trackId, boolean enabled)
    Sets the external audio track.
    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

    public abstract int setAdvancedAudioOptions(AdvancedAudioOptions options)
    set advanced audio option
    Parameters:
    options - advanced audio option.
    Returns:
    - 0: Success. - < 0: Failure.
  • setAVSyncSource

    public abstract int setAVSyncSource(String channelId, int uid)
    Bind local user and a remote user as an audio&video sync group. The remote user is defined by cid and uid. There’s a usage limit that local user must be a video stream sender. On the receiver side, media streams from same sync group will be time-synced
    Parameters:
    channelId - The channel id
    uid - The user ID of the remote user to be bound with (local user)
    Returns:
    - 0: Success. - < 0: Failure.
  • enableVideoImageSource

    public abstract int enableVideoImageSource(boolean enabled, ImageTrackOptions options)
    Enable or disable video image source to replace the current video source published or resume it
    Parameters:
    enabled - true for enable, false for disable
    options - options for image track
  • getNetworkType

    public abstract int getNetworkType()
    Get network type
    Returns:
    - 0: DISCONNECTED. - 1: LAN. - 2: WIFI. - 3: MOBILE_2G - 4: MOBILE_3G - 5: MOBILE_4G - 6: MOBILE_5G - -1: UNKNOWN
  • getNtpWallTimeInMs

    public abstract long getNtpWallTimeInMs()
    Return current NTP(unix timestamp) time in milliseconds.
  • startMediaRenderingTracing

    public abstract int 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

    public abstract int 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

    public abstract int setupAudioAttributes(AudioAttributes attr)
    配置AudioAttribute
    Parameters:
    AudioAttributes -
    Returns:
    - 0: 方法调用成功 - < 0: 方法调用失败
  • isFeatureAvailableOnDevice

    public abstract boolean isFeatureAvailableOnDevice(int type)
    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

    public abstract int sendAudioMetadata(byte[] metadata)
    Parameters:
    metadata - Audio Metadata.
    Returns:
    - 0: Success. - < 0: Failure.
    Since:
    v4.3.1