Ios_zh - aopacloud/aopa-rtc GitHub Wiki
本页列出 Android 所有的接口类以及其中包含的 API。
RTC SDK 的基础接口类,实现实时音视频的主要功能。
#AopaRtcEngineKit 提供了 App 调用的主要方法。
相关参考
return
/**
* Adjusts the volume of the audio mixing for local playback.
* @param volume The volume level to set, ranging from 0 to 100.
* @return
* - 0: Indicates success.
* - Negative values: Indicate failure.
*/
/**
* Adjusts the volume of the audio mixing for publishing to remote users.
* @param volume The volume level to set, ranging from 0 to 100.
* @return
* - 0: Indicates success.
* - Negative values: Indicate failure.
*/
/**
* Adjusts the volume of the audio mixing.
* @param volume The audio mixing volume. The valid range is typically between 0 and 100.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Adjusts the playback volume for all remote users.
* @param volume The playback volume for all remote users. Valid range: [0, 400].
* - 0: Mute.
* - 100: Original volume.
* - 400: Maximum volume with signal clipping protection.
* @note To mute local audio playback, set the volume to 0 using both adjustPlaybackSignalVolume and adjustAudioMixingVolume.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Adjusts the volume of the audio recording signal.
* @param volume The recording volume. Valid range: [0, 400].
* - 0: Mute.
* - 100: Original volume.
* - 400: Maximum volume with signal clipping protection.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Adjusts the playback volume for a specified remote user.
* @param uid The unique identifier of the remote user.
* @param volume The playback volume, ranging from 0 (mute) to 100 (maximum volume).
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Creates a data stream for sending and receiving data.
* @note
* - Up to five data streams can be created per user.
* - Set both reliable and ordered parameters consistently (both true or both false).
* @param streamId The ID assigned to the created data stream.
* @param reliable true if the data stream must be received by the recipient within 5 seconds; otherwise, false.
* @param ordered true if the data stream must be received in the sent order; otherwise, false.
* @return
* - 0: Indicates success.
* - Negative value: Indicates failure.
*/
/**
* Disables the audio module, stopping all audio-related processes.
* @note This method can be called at any time to affect the internal engine state.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Disables the video module, switching to audio-only mode.
*
* This method can be called before or during a call to start in audio mode or to switch
* from video mode to audio mode. To enable the video module, use the \ref IRtcEngine::enableVideo "enableVideo" method.
*
* A successful call of this method will trigger the \ref IRtcEngineEventHandler::onUserEnableVideo "onUserEnableVideo" (false)
* callback on the remote client.
*
* @note
* - This method can be called after \ref IRtcEngine::leaveChannel "leaveChannel".
* - For more granular control over video settings, refer to other video control methods.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates failure. See error codes for details.
*/
/**
* Enables the audio module, which is enabled by default.
* @note This method can be called at any time to affect the internal engine state.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Enables the onAudioVolumeIndication callback to report which users are speaking and the volume of their speech at set intervals.
* @param interval The interval between volume indications, in milliseconds. Set to 0 to disable.
* @param smooth The smoothing factor for the volume indicator, ranging from 0 to 10. A higher value makes the indicator more sensitive.
* @param report_vad Whether to enable voice activity detection for the local user and report its status in the onAudioVolumeIndication callback.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Enables or disables dual-stream mode for the live broadcast scenario.
* @param enabled true to enable dual-stream mode, false to disable and use single-stream mode.
*/
return
/**
* Enables in-ear monitoring on Android and iOS devices.
* @param enabled true to enable, false to disable in-ear monitoring.
* @return
* - 0: Success.
* - < 0: Failure.
*/
/**
* Enables or disables the local audio function, controlling the local audio capturing.
* @param enabled true to enable, false to disable the local audio function.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Enables or disables the local video capture.
* @param enabled true to enable local video capture, false to disable it.
* @note
* - Disabling local video capture does not affect the reception of remote video streams.
* - After calling enableVideo, local video capture is enabled by default. Use enableLocalVideo(false) to disable it.
* - The onUserEnableLocalVideo callback is triggered on remote clients after the local video capture is successfully enabled or disabled.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Enables the video module for audio/video communication.
*
* This method can be called before or during a call. If called before joining a channel,
* the channel will start in video mode. If called during an audio call, it will switch
* to video mode. To disable the video module, use the \ref IRtcEngine::disableVideo "disableVideo" method.
*
* A successful call of this method will trigger the \ref IRtcEngineEventHandler::onUserEnableVideo "onUserEnableVideo" (true)
* callback on the remote client.
*
* @note
* - This method can be called after \ref IRtcEngine::leaveChannel "leaveChannel".
* - For more granular control over video settings, refer to other video control methods.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates failure. See error codes for details.
*/
/**
* @deprecated As of v3.0.0, the Native SDK automatically enables interoperability with the Web SDK, making this method obsolete.
* Enables interoperability with the Aopa Web SDK.
* @note
* - Only applicable to the Live-broadcast profile. In Communication profile, Web SDK interoperability is enabled by default.
* - Ensure this method is called if the channel includes Web SDK users to prevent video black screen issues for Web users.
* @param enabled true to enable, false to disable interoperability with the Aopa Web SDK.
* @return
* - 0: Success.
* - < 0: Failure.
*/
/**
* Retrieves the current playback position of the music file in milliseconds.
* @note This method should be called while in a channel.
* @return
* - >= 0: Indicates the current playback position of the audio mixing if the method call succeeds.
* - < 0: Indicates failure.
*/
/**
* Retrieves the duration of the music file in milliseconds.
* @note This method should be called while in a channel.
* @return
* - >= 0: Indicates the audio mixing duration if the method call succeeds.
* - < 0: Indicates failure.
*/
/**
* Retrieves the current volume level of the audio mixing for local playback.
* @return
* - >= 0: The current volume level if successful.
* - Negative values: Indicate failure.
*/
/**
* Retrieves the audio mixing volume for publishing, which is used to help troubleshoot audio volume related issues.
* @note This method should be called while in a channel.
* @return
* - >= 0: Indicates the audio mixing volume for publishing if the method call succeeds. The value range is [0, 100].
* - < 0: Indicates failure.
*/
/**
* Retrieves the current connectivity status of the SDK.
*
* @return The current #CONNECTION_STATE_TYPE.
*/
/**
* Gets the current playback position of the specified audio effect file.
* @param soundId The unique identifier for the audio effect.
* @return
* - >= 0: The current playback position in milliseconds if the method call succeeds.
* - < 0: Indicates an error occurred, such as the audio effect not being found.
*/
/**
* Retrieves the total duration of the specified audio effect file.
* @param filePath The absolute path or URL to the audio file.
* @return
* - >= 0: The duration of the audio effect file in milliseconds if the method call succeeds.
* - < 0: Indicates an error occurred, such as the file not being found.
*/
/**
* Retrieves the volume of the audio effects, which ranges between 0.0 and 100.0.
* @return
* - >= 0: The volume of the audio effects if the method call succeeds.
* - < 0: Indicates failure.
*/
/**
* Retrieves the version number of the SDK.
* @param build If not NULL, the method also returns the build number of the SDK.
* @return A string representing the version of the current SDK, such as "2.3.1".
*/
/**
* Checks whether the speakerphone is currently enabled.
* @return true if the speakerphone is enabled, false otherwise.
*/
/**
* Joins a channel with the specified user ID for audio/video communication.
*
* Users in the same channel can communicate with each other. To join a channel,
* you must first call the \ref IRtcEngine::leaveChannel "leaveChannel" method to exit any
* current channel.
*
* A successful join will trigger the \ref IRtcEngineEventHandler::onJoinChannelSuccess "onJoinChannelSuccess"
* callback on the local client and the \ref IRtcEngineEventHandler::onUserJoined "onUserJoined" callback
* on remote clients, depending on the user role.
*
* @note Ensure each user has a unique user ID. The system assigns a user ID if \p uid is set to 0.
* @warning Use the same App ID for token generation as used in the \ref IRtcEngine::initialize "initialize" method.
*
* @param token Pointer to the token string generated by the application server.
* @param channelId Pointer to the unique channel name string, with a maximum length of 63 bytes.
* @param info Optional additional channel information.
* @param uid User ID; must be unique and within the range of 1 to 2^32-1.
* @return
* - 0: Success
* - < 0: Failure (See error codes for details)
*/
/**
* Leaves the current channel and ends the communication session.
*
* This method is asynchronous; the \ref IRtcEngineEventHandler::onLeaveChannel "onLeaveChannel"
* callback indicates that the user has successfully left the channel.
*
* @return
* - 0: Success
* - < 0: Failure (See error codes for details)
*/
// Assuming leaveChannel2 is an overloaded function or a follow-up method,
// the comment should reflect any differences from leaveChannel if applicable.
/**
* Mutes or unmutes all remote audio streams.
* @param mute true to mute, false to unmute all remote audio streams.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Mutes or unmutes all remote video streams.
* @param mute true to stop receiving all remote video streams, false to resume receiving.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Mutes or unmutes the local audio stream.
* @param mute true to mute, false to unmute the local audio stream.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Mutes or unmutes the local video stream.
* A successful call to this method triggers the onUserMuteVideo callback on remote clients.
* @param mute true to stop sending the local video stream, false to resume sending.
* @note
* - Setting mute to true does not disable the camera and does not affect the retrieval of local video streams.
* - If setChannelProfile is called after this method, the SDK resets the local video stream's mute state according to the channel profile and user role. It is recommended to call this method after setChannelProfile.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Mutes or unmutes the audio stream of a specified remote user.
* @param userId The ID of the remote user whose audio stream is to be muted or unmuted.
* @param mute true to stop receiving the audio stream from the specified remote user, false to resume receiving.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Mutes or unmutes the video stream of a specified remote user.
* @param userId The ID of the remote user whose video stream is to be muted or unmuted.
* @param mute true to stop receiving the video stream from the specified remote user, false to resume receiving.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Pauses all currently playing audio effects.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Pauses the currently playing audio mix.
* @return
* - 0: Indicates success.
* - Negative values: Indicate failure.
*/
/**
* Pauses a specified audio effect.
* @param soundId Unique identifier for the audio effect to pause.
* @return
* - 0: Success.
* - < 0: Failure.
*/
/**
* Plays a specified local or online audio effect file.
* @since v3.4.0
* @param soundId Unique identifier for the audio effect. Used to reference the preloaded effect.
* @param filePath Absolute path or URL to the audio file, supporting formats like MP3, AAC, etc.
* @param loopCount Number of times the audio effect should loop. Use -1 for an indefinite loop.
* @param pitch Pitch adjustment for the audio effect, ranging from 0.5 to 2.0.
* @param pan Spatial positioning of the audio effect, ranging from -1.0 (left) to 1.0 (right).
* @param gain Volume adjustment for the audio effect, ranging from 0.0 to 100.0.
* @param publish Determines if the audio effect should be published to remote users.
* @param startPos Starting position of the audio playback in milliseconds.
* @return
* - 0: Success.
* - < 0: Failure.
*/
/**
* Preloads a specified audio effect file into memory to enhance performance during a call.
* @note Does not support online audio files and recommends limiting file size for smooth communication.
* @param soundId Unique identifier for the audio effect.
* @param filePath Absolute path to the audio file, supporting formats like mp3, aac, etc.
* @return
* - 0: Success.
* - < 0: Failure.
*/
/**
* Renews the token when the current token is about to expire.
*
* The token is essential for authentication and will expire after a set time.
* The SDK will trigger the \ref IRtcEngineEventHandler::onTokenPrivilegeWillExpire
* "onTokenPrivilegeWillExpire" callback or report CONNECTION_CHANGED_TOKEN_EXPIRED(9)
* via the \ref IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged"
* when the token is nearing expiration.
*
* @param token The new token string acquired from the server.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates failure. See error codes for details.
*/
/**
* Resumes playback of the audio mix after it has been paused.
* @return
* - 0: Indicates success.
* - Negative values: Indicate failure.
*/
/**
* Resumes playing all audio effects that have been paused.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Sends data through a specified data stream to all users in the channel.
* @note
* - Limited to 30 packets per second per channel, with each packet up to 1 kB in size.
* - Each client can send up to 6 kB of data per second.
* - Each user can have up to five data streams simultaneously.
* - Use createDataStream to obtain a stream ID before sending data.
* @param streamId The ID of the data stream for sending messages.
* @param data Pointer to the data to be sent.
* @param length The length of the data to be sent.
* @return
* - 0: Indicates success.
* - Negative value: Indicates failure.
*/
// Added by bhb on 2021/03/26
/**
* Applies a predefined audio effect preset.
*
* @param preset The selected #AUDIO_EFFECT_PRESET.
*
* @return
* - 0: Preset applied successfully.
* - < 0: Application failed.
*/
/**
* Sets the pitch of the local music file when mixed with a local human voice.
* @since v3.0.1
* @note This method should be called after starting audio mixing and receiving the onAudioMixingStateChanged callback with AUDIO_MIXING_STATE_PLAYING state.
* @param pitch The pitch value, ranging from -12 to 12. A value of 0 indicates the original pitch.
* @return
* - 0: Indicates success.
* - < 0: Indicates failure.
*/
/**
* Sets the playback position of the music file to a specified starting position in milliseconds.
* @param pos The desired playback starting position of the music file in milliseconds.
* @return
* - 0: Indicates success.
* - < 0: Indicates failure.
*/
/**
* Sets the audio profile and scenario for optimized audio settings.
* @param profile The audio profile to set, which defines the sample rate, bitrate, encoding mode, and the number of channels. See AUDIO_PROFILE_TYPE.
* @param scenario The audio scenario to set, which affects the volume tracks used by the device, such as in-call volume or media volume. See AUDIO_SCENARIO_TYPE. For more information on volume tracks, see the system volume FAQ.
* @note The method must be called before joining a channel. The bitrate may vary based on network conditions.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Adjusts image enhancement settings and toggles the feature on or off.
*
* @note
* - Invoke this function after enabling video functionality with `enableVideo`.
* - Currently unsupported on macOS platforms.
* @param enabled A boolean flag to control image enhancement activation:
* - `true`: Enables image enhancement features.
* - `false`: Disables image enhancement features.
* @param options An instance of `BeautyOptions` struct to customize the image enhancement parameters.
*
* @return
* - 0: The operation was successful.
* - < 0: An error occurred, refer to error codes for specifics.
*/
/**
* Configures the camera capture settings to optimize performance or preview quality.
*
* @param config The camera capturer configuration. See CameraCapturerConfiguration.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates failure. See error codes for details.
*/
/**
* Configures the channel profile for the Aopa RtcEngine.
*
* The RtcEngine optimizes performance based on the specified channel profile,
* e.g., emphasizing low latency for voice calls or high video quality for broadcasts.
*
* @note
* - Ensure all participants in a channel use the same profile for optimal real-time communication.
* - This method must be invoked before \ref IRtcEngine::joinChannel "joinChannel".
* Once in a channel, the profile cannot be altered.
*
* @param profile The desired channel profile. Refer to #CHANNEL_PROFILE_TYPE for options.
*
* @return
* - 0: The profile was set successfully.
* - < 0: An error occurred.
*/
/**
* Assigns or alters the user role in a live broadcast channel.
*
* This function allows role switching post-channel join, applicable for live streaming scenarios.
*
* In a live broadcast, a successful role change via \ref bb::rtc::IRtcEngine::setClientRole "setClientRole"
* will notify clients via these callbacks:
* - Local client: \ref bb::rtc::IRtcEngineEventHandler::onClientRoleChanged "onClientRoleChanged".
* - Remote clients: \ref bb::rtc::IRtcEngineEventHandler::onUserJoined "onUserJoined" or
* \ref bb::rtc::IRtcEngineEventHandler::onUserOffline "onUserOffline" (when becoming an audience).
*
* @note Restricted to the Live Broadcast profile.
*
* @param role The new role for the user. See #CLIENT_ROLE_TYPE for definitions.
*
* @return
* - 0: Role updated successfully.
* - < 0: Update failed.
*/
/**
* Sets the playback position for a specified audio effect file.
* @param soundId The unique identifier for the audio effect.
* @param pos The new playback position in milliseconds.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred, such as the audio effect not being found.
*/
/**
* Sets the volume of the audio effects.
* @param volume The volume level to set, ranging from 0 to 100.
* @return
* - 0: Indicates success.
* - < 0: Indicates failure.
*/
/**
* Enables or disables the speakerphone as the audio route for playback.
* @param speakerOn true to use speakerphone, false to use earpiece.
* @return
* - 0: Success.
* - < 0: Failure.
*/
/**
* Sets the encryption mode for the built-in encryption feature of the SDK.
* @note
* - Call setEncryptionSecret first to enable encryption.
* - All users in the channel must use the same mode and password.
* @param encryptionMode The encryption mode to set (e.g., "aes-128-xts", "aes-128-ecb", "aes-256-xts").
* @return
* - 0: Indicates success.
* - Negative value: Indicates failure.
*/
/**
* Enables built-in encryption for the SDK with a specified password before joining a channel.
* All users in the same channel must use the same encryption password, which is cleared upon leaving the channel.
* If no password is set, encryption is disabled.
* @note
* - Not recommended for CDN live streaming.
* - Ensure encrypted data size does not exceed original size + 16 bytes (AES encryption padding).
* @param secret The encryption password to be used.
* @return
* - 0: Indicates success.
* - Negative value: Indicates failure.
*/
/**
* Sets the volume of the in-ear monitor for Android and iOS devices.
* @param volume The volume level for the in-ear monitor, ranging from 0 to 100.
* @return
* - 0: Success.
* - < 0: Failure.
*/
/**
* Updates the display mode for the local video view, including rendering and mirror modes.
* @param renderMode The rendering mode of the local video view. See RENDER_MODE_TYPE for options.
* @param mirrorMode The mirror mode of the local video view. See VIDEO_MIRROR_MODE_TYPE for options.
* @note This method only affects the local user's view and not the published video stream.
* @return
* - 0: Success.
* - < 0: Failure.
*/
/**
* Sets the equalization effect for the local voice across specified frequency bands.
* @param bandFrequency The band frequency to adjust. See AUDIO_EQUALIZATION_BAND_FREQUENCY for options.
* @param bandGain The gain to apply to the specified band in decibels, ranging from -15 to 15.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Adjusts the pitch of the local speaker's voice.
* @param pitch The pitch value to set, ranging from 0.5 to 2.0. A value of 1.0 means no change.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Sets the reverberation effect for the local voice.
* @param reverbKey The reverberation key defining the type of reverberation. See AUDIO_REVERB_TYPE for options.
* @param value The value to set for the reverberation key.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Specifies the file path for the SDK's output log, which records all runtime operations.
* If the specified log file doesn't exist, the SDK will create one.
* @note
* - The default log file is typically located in a directory such as "C:\Users\<user_name>\AppData\Local\Aopa\<process_name>".
* - It is recommended to call this method right after the initialize method to ensure complete log output.
* @param filePath The UTF-8 encoded string file path of the log file.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Sets the maximum size of the SDK's log files in kilobytes.
* @param fileSizeInKBytes The maximum size of the log files in KB.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Sets the log output level for the SDK, determining the types of logs to record.
* @param filter The log filter level to set. See LOG_FILTER_TYPE for options.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Adjusts low-light enhancement settings.
*
* @param enabled `true` to enable, `false` to disable.
* @param options Detailed enhancement options.
*
* @return
* - 0: Settings applied successfully.
* - < 0: Application failed.
*/
/**
* Sets the audio format for the onMixedAudioFrame callback, which handles mixed audio frames.
* @param sampleRate The sample rate in Hz for the mixed audio. Common values are 8000, 16000, 32000, 44100, or 48000.
* @param samplesPerCall The number of audio samples returned per callback. Commonly set to 1024 for streaming applications.
* @note The onMixedAudioFrame callback is triggered based on the sample interval, which should be at least 0.01 seconds.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Configures SDK behaviors and enables experimental features through JSON parameters.
*
* Note: These JSON options are currently non-public. Aopa is actively working towards exposing common options through standardized APIs.
*
* @param parameters A JSON-formatted string containing the desired configuration parameters.
*
* @return
* - 0: Configuration successful.
* - < 0: Configuration failed.
*/
/**
* Sets the audio playback format for the onPlaybackAudioFrame callback.
* @param sampleRate The sample rate in Hz for the played audio.
* @param channel The number of audio channels (1 for mono, 2 for stereo).
* @param mode The operation mode for the audio frame callback. See RAW_AUDIO_FRAME_OP_MODE_TYPE for options.
* @param samplesPerCall The number of samples per callback call, often set to 1024 for streaming.
* @note Ensure the sample interval is no less than 0.01 seconds.
* @return
* - 0: Success.
* - < 0: Failure.
*/
/**
* Sets the audio recording format for the onRecordAudioFrame callback.
* @param sampleRate The sample rate in Hz for the recorded audio.
* @param channel The number of audio channels (1 for mono, 2 for stereo).
* @param mode The operation mode for the audio frame callback. See RAW_AUDIO_FRAME_OP_MODE_TYPE for options.
* @param samplesPerCall The number of samples per callback call, often set to 1024 for streaming.
* @note Ensure the sample interval is no less than 0.01 seconds.
* @return
* - 0: Success.
* - 0: Failure.
*/
/**
* Sets the default video stream type for all remote users when dual streams are being sent.
* @param streamType The default type of video stream to receive. See REMOTE_VIDEO_STREAM_TYPE for possible values.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* @deprecated This method is deprecated. Use setRemoteRenderMode(uid_t, RENDER_MODE_TYPE, VIDEO_MIRROR_MODE_TYPE) instead.
* Sets the video display mode for a specified remote user.
* @param userId The ID of the remote user.
* @param renderMode The video display mode to set. See RENDER_MODE_TYPE for options.
* @return
* - 0: Success.
* - < 0: Failure.
*/
/**
* Specifies the fallback behavior for remote subscription in the event of network degradation.
*
* Determines how the system should react when the subscribed remote stream quality deteriorates due to network conditions. The reaction strategy is determined by the `STREAM_FALLBACK_OPTIONS` value passed as `option`.
*
* @param option A `STREAM_FALLBACK_OPTIONS` enum member indicating the fallback action to take when the remote stream subscription encounters network problems.
*
* @return
* - 0: The remote subscribe fallback option was configured successfully.
* - < 0: An error was encountered while setting the fallback option.
*/
/**
* Sets the video stream type for a remote user when dual streams are being sent.
* @param userId The ID of the remote user sending the video streams.
* @param streamType The type of video stream to receive. See REMOTE_VIDEO_STREAM_TYPE for possible values.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Sets up the local video view for preview before joining a channel.
*
* @param canvas The local video view settings. See VideoCanvas.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates failure. See error codes for details.
*/
/**
* Sets up the video view for a remote user.
*
* @param canvas The remote video view settings. See VideoCanvas.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates failure. See error codes for details.
*/
/**
* Sets the video encoder configuration with a set of parameters including resolution, frame rate, bitrate, and orientation.
*
* @param config The local video encoder configuration. See VideoEncoderConfiguration.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates failure. See error codes for details.
*/
/**
* Sets the video profile. As of v2.3, this method is deprecated; use \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" instead.
*
* @deprecated
* @param profile The video profile to set. See #VIDEO_PROFILE_TYPE.
* @param swapWidthAndHeight Whether to swap the width and height of the video stream.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates failure. See error codes for details.
*/
/**
* Selects a voice beautifier preset.
*
* @param preset The chosen #VOICE_BEAUTIFIER_PRESET.
*
* @return
* - 0: Preset set successfully.
* - < 0: Setting failed.
*/
/**
* Sets the volume of a specified audio effect.
* @param soundId The unique ID of the audio effect.
* @param volume The volume level to set for the specified audio effect, ranging from 0 to 100.
* @return
* - 0: Indicates success.
* - < 0: Indicates failure.
*/
/**
* Starts audio mixing by playing a music file that is mixed with the microphone audio stream.
* @param filePath The absolute path to the local or online audio file for mixing.
* @param loopback Determines if only the local user can hear the mixed audio.
* @param replace Determines if the audio file replaces the microphone stream or is mixed with it.
* @param cycle The number of times the audio file will loop; use -1 for infinite looping.
* @note
* - Call this method while in a channel.
* - Unsupported file formats or inaccessible URLs may result in an error.
* - The onAudioMixingStateChanged callback indicates the start and finish of playback.
* @return
* - 0: Indicates success.
* - Negative values: Indicate failure.
*/
/**
* Initiates audio recording on the client.
* Once initiated, the audio of all users in the channel can be recorded to a file.
* @param filePath The absolute path to the output audio file, in UTF-8 encoding.
* @param sampleRate The sample rate of the recording in kHz. Supported values: 16, 32 (default), 44.1, 48.
* @param quality The quality setting for the audio recording. See AUDIO_RECORDING_QUALITY_TYPE for options.
* @note
* - Ensure the specified directory is accessible and has write permissions.
* - This method should be called after joining a channel, and the recording will cease upon leaving the channel.
* - For optimal quality, use #AUDIO_RECORDING_QUALITY_MEDIUM or #AUDIO_RECORDING_QUALITY_HIGH at a sampleRate of 44.1 kHz or 48 kHz.
* @return
* - 0: Indicates success.
* - Negative values: Indicate failure.
*/
/**
* Starts the local video preview.
*
* Call this method after setting up the local video and enabling video.
*
* @note The preview will continue even after leaving the channel until \ref IRtcEngine::stopPreview "stopPreview" is called.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates failure. See error codes for details.
*/
/**
* Stops all audio effects currently playing.
* @return
* - 0: Success.
* - < 0: Failure.
*/
/**
* Stops the currently playing audio mix.
* @return
* - 0: Indicates success.
* - Negative values: Indicate failure.
*/
/**
* Stops an audio recording session on the client.
* @note This method should be called before leaving the channel; otherwise, the recording will stop automatically.
* @return
* - 0: Indicates success.
* - Negative values: Indicate failure.
*/
/**
* Terminates the ongoing media stream relay process.
*
* Upon stopping, the broadcaster is disconnected from all destination channels.
*
* Post-execution, the \ref bb::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged
* "onChannelMediaRelayStateChanged" callback signifies the relay status change.
* A return of #RELAY_STATE_IDLE (0) and #RELAY_OK (0) confirms a successful relay halt.
* @note
* In case of failure, the SDK issues the
* \ref bb::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged
* "onChannelMediaRelayStateChanged" callback with either
* #RELAY_ERROR_SERVER_NO_RESPONSE (2) or #RELAY_ERROR_SERVER_CONNECTION_LOST (8).
* Exiting the channel via \ref leaveChannel() also discontinues the relay.
* @return
* - 0: Operation completed successfully.
* - < 0: An error was encountered.
*/
/**
* Stops playing a specified audio effect by its unique ID.
* @param soundId Unique identifier for the audio effect to stop.
* @return
* - 0: Success.
* - < 0: Failure.
*/
/**
* Stops the local video preview and disables the video module.
* @return
* - 0: Indicates the operation was successful.
* - Negative value: Indicates an error occurred.
*/
/**
* Switches between the front and rear cameras on Android and iOS devices.
* @return
* - 0: Success.
* - < 0: Failure.
*/
/**
* Unloads a preloaded audio effect from memory.
* @param soundId Unique identifier for the audio effect to unload.
* @return
* - 0: Success.
* - < 0: Failure.
*/
/** Starts the audio playback device test.
This method tests if the playback device works properly. In the test, the SDK plays an audio file specified by the user. If the user can hear the audio, the playback device works properly.
@param testAudioFilePath Pointer to the path of the audio file for the audio playback device test in UTF-8:
- Supported file formats: wav, mp3, m4a, and aac.
- Supported file sample rates: 8000, 16000, 32000, 44100, and 48000 Hz.
@return
- 0: Success, and you can hear the sound of the specified audio file.
- < 0: Failure.
*/
/** Starts the microphone test.
This method tests whether the microphone works properly. Once the test starts, the SDK uses the \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback to notify the application with the volume information.
@param indicationInterval Interval period (ms) of the \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback cycle.
@return
- 0: Success.
- < 0: Failure.
*/
/** Stops the audio playback device test.
This method stops testing the audio playback device. You must call this method to stop the test after calling the \ref IAudioDeviceManager::startPlaybackDeviceTest "startPlaybackDeviceTest" method.
@return
- 0: Success.
- < 0: Failure.
*/
/** Stops the microphone test.
This method stops the microphone test. You must call this method to stop the test after calling the \ref IAudioDeviceManager::startRecordingDeviceTest "startRecordingDeviceTest" method.
@return
- 0: Success.
- < 0: Failure.
*/
接口类 AopaRtcEngineDelegate
用于 SDK 向 App 发送事件通知,App 通过继承该接口类的方法获取 SDK 的事件通知。
该接口类的所有方法都有缺省(空)实现, App 可以根据需要只继承关心的事件。
注意
- 在回调方法中,App 不应该做耗时或者调用可能会引起阻塞的 API(如
sendMessage
),否则可能影响 SDK 的运行。 - SDK 不再捕获开发者在 IRtcEngineEventHandler 类回调中自行实现的代码逻辑中的异常。你需要自行处理该异常,否则异常出现时可能引起 App 崩溃。
相关参考
/**
* Identifies the loudest speaker in the channel.
*
* @param uid Unique identifier of the loudest speaker. A value of 0 signifies the local user.
*/
/**
* Called when an audio effect playback finishes.
* @param soundId The unique identifier for the audio effect that has finished playing.
*/
/**
* Called to notify the application of changes in the state of audio mixing.
* @param state The current state of the audio mixing. See AUDIO_MIXING_STATE_TYPE for possible values.
* @param errorCode The reason for the state change, if any. See AUDIO_MIXING_REASON_TYPE for possible values.
*/
/**
* @brief Notifies of changes in the audio publishing state.
*
* @since v3.1.0
*
* Signals state transitions in the publishing of the local audio stream.
*
* @param channel Name of the channel related to the publishing state change.
* @param oldState Previous publishing state, refer to #STREAM_PUBLISH_STATE.
* @param newState Current publishing state, refer to #STREAM_PUBLISH_STATE.
* @param elapseSinceLastState Time (in ms) from the last state to the current one.
*/
/**
* @brief [DEPRECATED] Reports the audio quality statistics for each remote user/host.
*
* @deprecated As of v2.3.2, use \ref bb::rtc::IRtcEngineEventHandler::onRemoteAudioStats "onRemoteAudioStats" instead.
*
* This callback is triggered every two seconds to provide audio quality metrics for each remote user/host transmitting audio in the channel. If multiple users are sending audio, the callback is fired accordingly for each one.
*
* @param uid Unique identifier of the remote user whose audio quality is being reported.
* @param quality Audio quality metric based on #QUALITY_TYPE.
* @param delay Network latency (in ms) from sender to receiver, inclusive of processing, transmission, and jitter buffer delays.
* @param lost Packet loss rate (%) of audio packets during transmission from sender to receiver.
*/
/**
* Called when the local audio route changes.
* The SDK triggers this callback when the audio route is switched to an earpiece, speakerphone, headset, or Bluetooth device.
* @note This callback is for Android and iOS only.
* @param routing The new audio output routing. See AUDIO_ROUTE_TYPE for possible values.
*/
/**
* Notifies about changes in the subscription state of a remote audio stream.
*
* @param channel The channel name where the event is happening.
* @param uid The unique identifier of the remote user.
* @param oldState The previous subscription state; refer to #STREAM_SUBSCRIBE_STATE for more information.
* @param newState The current subscription state; refer to #STREAM_SUBSCRIBE_STATE for more information.
* @param elapseSinceLastState Time in milliseconds since the last state change.
*/
/**
* Provides information on active speakers, their volume levels, and the local user's speaking status.
*
* @param speakers Array of AudioVolumeInfo structures detailing speaker information.
* For the local user, `uid`=0, `volume`=totalVolume (sum of voice and audio mixing volume), and `vad`=voice activity detection status.
* For remote speakers, includes their `uid`, combined `volume`, and `vad`=0.
* An empty array implies no remote speaker activity.
* @param speakerNumber Total number of active speakers reported, ranging from 0 to 3.
* Always 1 for the local user, regardless of speaking status.
* For remote speakers, up to 3 loudest speakers are reported when more than 3 are present.
* @param totalVolume The combined volume after audio mixing, ranging from 0 (silent) to 255 (loudest).
* Represents local user's total volume in their callback, and total volume of all remote speakers otherwise.
*/
/**
* Notifies the application of a change in the camera's exposure area.
* @param x The x-coordinate of the top-left corner of the exposure area.
* @param y The y-coordinate of the top-left corner of the exposure area.
* @param width The width of the exposure area.
* @param height The height of the exposure area.
*/
/**
* Called when the camera's focus area is changed.
* This event is triggered whenever there is a change in the camera's focus area, which can affect image clarity.
* @param x The new focus area's x-coordinate.
* @param y The new focus area's y-coordinate.
* @param width The new focus area's width.
* @param height The new focus area's height.
*/
/**
* Called when the state of the media stream relay changes.
* @param state The new state of the media stream relay. See CHANNEL_MEDIA_RELAY_STATE for possible values.
* @param code The error code associated with the state change. See CHANNEL_MEDIA_RELAY_ERROR for possible values.
*/
/**
* Informs of a change in user role within a live broadcast (e.g., from broadcaster to audience).
*
* Triggered when the local user's role changes via \ref IRtcEngine::setClientRole "setClientRole", after joining a channel.
*
* @param oldRole The previous role of the user.
* @param newRole The updated role of the user.
*/
/**
* @brief [DEPRECATED] Notifies when the connection is banned by the Aopa server.
*
* @deprecated Replaced by \ref bb::rtc::IRtcEngineEventHandler::onConnectionStateChanged
* with state "CONNECTION_STATE_FAILED" and reason "CONNECTION_CHANGED_BANNED_BY_SERVER".
*/
/**
* @brief [DEPRECATED] Notifies when the connection between the SDK and server is interrupted.
*
* @deprecated Since v2.3.2, use \ref bb::rtc::IRtcEngineEventHandler::onConnectionStateChanged
* with reason "CONNECTION_STATE_RECONNECTING" and cause "CONNECTION_CHANGED_INTERRUPTED".
*
* Triggered when the SDK disconnects from the server for over 4 seconds post-connection.
* The SDK attempts to automatically reconnect after this event. Implement notifications
* or UI updates via this callback.
*
* Note: Differs from onConnectionLost in trigger conditions and timing.
*/
/**
* @brief Notifies when the SDK fails to reconnect to Aopa's edge server after a 10-second interruption.
*
* Triggered when reconnection efforts fail 10 seconds after initial disconnection, regardless
* of whether the client was in a channel or not.
*
* Note: This differs from onConnectionInterrupted in the duration before triggering and scenarios.
*/
/**
* Reports an error during SDK operation.
*
* Errors require application intervention or user notification, as the SDK cannot recover automatically. For example, an #ERR_START_CALL error necessitates informing the user and potentially invoking \ref IRtcEngine::leaveChannel "leaveChannel".
*
* @param err The error code identifying the specific issue.
* @param msg A pointer to a string providing further context about the error.
*/
/**
* Triggers when the first local video frame is displayed.
*
* @param width Width of the video frame in pixels.
* @param height Height of the video frame in pixels.
* @param elapsed Time in milliseconds from invoking joinChannel or startPreview until this callback.
*/
/**
* Called when the engine receives the first audio frame from a specific remote user.
* @param uid The user ID of the remote user.
* @param elapsed The time in milliseconds elapsed from the remote user calling joinChannel until this callback is triggered.
*/
/**
* Called when the first remote audio stream is decoded.
* @param uid The user ID of the remote user whose audio stream has been decoded.
* @param elapsed The time in milliseconds it took for the first remote audio to be decoded.
*/
/**
* Invoked when the first remote video frame is rendered.
*
* @param uid The remote user's ID who is sending the video stream.
* @param width Width of the video frame in pixels.
* @param height Height of the video stream in pixels.
* @param elapsed Time in milliseconds from the local user joining the channel until this callback.
*/
/**
* Notifies when a user successfully joins a channel.
*
* This callback signifies that a user has entered a channel after \ref IRtcEngine::joinChannel "joinChannel" was called. The channel name corresponds to the one provided in the join request, and if no user ID was specified, the server assigns one.
*
* @param channel Pointer to the name of the channel joined.
* @param uid The unique user ID assigned to the joining user.
* @param elapsed Time in milliseconds from the join request until this callback.
*/
/**
* Periodically updates (every 2 seconds) the last-mile network quality before a user joins a channel.
*
* Reflects the uplink and downlink conditions between the local device and Aopa's edge server, following a call to \ref IRtcEngine::enableLastmileTest "enableLastmileTest".
*
* @param quality The network quality level as defined by #QUALITY_TYPE.
*/
/**
* Indicates when a user leaves a channel.
*
* This callback delivers channel statistics upon a user exiting via \ref IRtcEngine::leaveChannel "leaveChannel".
*
* @param stats A reference to the \ref RtcStats structure containing call duration and other metrics.
*/
/**
* @brief Delivers the local audio stream statistics every two seconds.
*
* This callback provides a periodic update on the local audio stream's performance.
*
* @param stats Metrics for the local audio stream: LocalAudioStats.
*/
/**
* Called when the local video state changes.
* @param localVideoState The new state of the local video stream. See LOCAL_VIDEO_STREAM_STATE for possible values.
* @param error The error code indicating the cause of the state change, if any. See LOCAL_VIDEO_STREAM_ERROR for possible values.
*/
/**
* @brief Updates the statistics of the local video stream every two seconds.
*
* This callback is for each local user/host and is called every two seconds. In multi-user scenarios, expect multiple invocations.
*
* @note If dual streaming is enabled via \ref bb::rtc::IRtcEngine::enableDualStream "enableDualStream", this callback reports on the high-quality video stream.
*
* @param stats Detailed metrics for the local video stream: LocalVideoStats.
*/
/**
* @brief Periodically reports the last-mile network quality for each user in the channel.
*
* The 'last mile' pertains to the link between the local device and Aopa's edge server. This callback is issued every two seconds to update on the network conditions experienced by each participant. If multiple users are present, expect multiple invocations.
*
* @param uid Unique identifier of the user. If @p uid equals 0, it refers to the local user.
* @param txQuality Uplink transmission quality assessment considering bitrate, packet loss, RTT, and jitter. Reflects suitability of current uplink for chosen video encoding settings. See #QUALITY_TYPE.
* @param rxQuality Downlink network quality score based on packet loss, RTT, and jitter. Refer to #QUALITY_TYPE.
*/
/**
* Called when the local network type changes, indicating if the network connection is interrupted due to a network type change or poor conditions.
* @param type The new local network type. See NETWORK_TYPE for possible values.
*/
/**
* Triggers upon a user successfully rejoining a channel after a network disruption.
*
* Following a network interruption, the SDK automatically attempts to reconnect and invokes this callback upon success.
*
* @param channel Pointer to the name of the channel rejoined.
* @param uid The unique user ID of the rejoining user.
* @param elapsed Time in milliseconds from the start of reconnection efforts until this callback.
*/
/**
* @brief Notifies when the remote audio state changes.
*
* Reflects changes in the remote user's audio stream state.
*
* @param uid Unique identifier of the remote user experiencing the audio state change.
* @param state New state of the remote audio stream, see #REMOTE_AUDIO_STATE.
* @param reason Reason behind the remote audio state change, see #REMOTE_AUDIO_STATE_REASON.
* @param elapsed Time (in ms) since joining the channel until this callback is triggered.
*/
/**
* @brief Supplies statistics of the remote audio streams every two seconds.
*
* This callback supersedes \ref bb::rtc::IRtcEngineEventHandler::onAudioQuality "onAudioQuality". It is invoked every two seconds per remote user/host, with multiple calls in multi-participant channels.
*
* @param stats Array pointer to remote audio stream statistics objects: RemoteAudioStats.
*/
/**
* Called when the remote media stream falls back to audio-only due to poor network conditions or switches back to video when the network improves.
* @param uid The user ID of the remote user whose media stream has changed.
* @param isFallbackOrRecover true if the remote stream has fallen back to audio-only; false if it has switched back to video.
*/
/**
* Called when the state of the remote video changes.
* @param uid The user ID of the remote user whose video state has changed.
* @param state The new state of the remote video. See REMOTE_VIDEO_STATE for possible values.
* @param reason The reason for the change in the remote video state. See REMOTE_VIDEO_STATE_REASON for more information.
* @param elapsed The time in milliseconds since the local user joined the channel until this callback is triggered.
*/
/**
* @brief Reports statistics of the remote video stream every two seconds per user/host.
*
* For each remote participant in the channel, this callback is triggered every two seconds to deliver video stream stats. In multi-user channels, anticipate multiple callbacks.
*
* @param stats Object encapsulating remote video stream statistics: RemoteVideoStats.
*/
/**
* Deprecated: Replaced by the onRemoteVideoStats callback.
* Called to report the transport-layer statistics of each remote video stream, such as packet loss rate and network delay.
* @param uid The user ID of the remote user sending the video packet.
* @param delay The network delay from when the video packet was sent to when it was received.
* @param lost The packet loss rate of the received video packet.
* @param rxKBitRate The received bitrate of the received video packet.
*/
/**
* @brief Triggers when the token used for authentication is about to expire or has expired.
*
* Requires the application to fetch and set a new token via renewToken to maintain session continuity.
*/
/**
* @brief Provides periodic statistics of the ongoing call.
*
* Triggered every two seconds following a successful channel join, delivering metrics on the RTC engine performance.
*
* @param stats Comprehensive statistics object for the RTC session: RtcStats.
*/
/**
* Called when the state of the RTMP streaming changes.
* This callback is triggered by the SDK to report the result of the local user calling addPublishStreamUrl or removePublishStreamUrl.
* @param url The RTMP URL address.
* @param state The current RTMP streaming state. See RTMP_STREAM_PUBLISH_STATE for possible values.
* @param errCode The detailed error information for the streaming. See RTMP_STREAM_PUBLISH_ERROR for possible values.
*/
/**
* Called when the local user receives a data stream message from a remote user within five seconds.
* @param uid The User ID of the remote user who sent the message.
* @param streamId The ID of the data stream.
* @param data A pointer to the data received.
* @param length The length of the data in bytes.
*/
/**
* Called when the local user fails to receive a data stream message from a remote user within five seconds.
* @param uid The User ID of the remote user who attempted to send the message.
* @param streamId The ID of the data stream.
* @param code The error code. See ERROR_CODE_TYPE for possible values.
* @param missed The number of messages that were not received.
* @param cached The number of messages cached while the data stream was interrupted.
*/
/**
* @brief Warns 30 seconds prior to token expiration to allow for proactive token renewal.
*
* @param tokenPointer Pointer to the token expiring soon.
*/
/**
* Called when the publisher's transcoding settings are updated.
* The SDK triggers this callback to report update information to the local host after changes to the LiveTranscoding class.
* @note The SDK does not trigger this callback if setLiveTranscoding is called for the first time.
*/
/**
* Alerts when another user (in Communication) or host (in Live Broadcast) enters the channel.
*
* - Communication scenario: Notifies of any new user joining.
* - Live Broadcast scenario: Specifically indicates a new host joining, with a recommendation to limit hosts to 17.
*
* Triggers in scenarios such as a user joining, role switching to host post-join, rejoining after a disconnect, or when a host adds an online media stream.
*
* @param uid The unique user ID of the joining/host user.
* @param elapsed Time in milliseconds from the local user's join request until this callback.
*/
/**
* Signals when a remote user mutes or unmutes their audio stream.
*
* @param uid The remote user's ID.
* @param muted True if the audio stream is muted; false if unmuted.
*/
/**
* Signals when a remote user/host exits the channel or goes offline.
*
* Reasons for a user being offline include voluntary channel departure or network disconnection. False positives may arise due to unreliable networks, hence a signaling system is advisable for accurate offline detection.
*
* @param uid The unique user ID of the offline user/host.
* @param reason The #USER_OFFLINE_REASON_TYPE explaining the offline status.
*/
/**
* Reports the change in the local video publishing state.
*
* @param channel The identifier for the channel where the event occurs.
* @param oldState The previous publishing state; refer to #STREAM_PUBLISH_STATE for details.
* @param newState The current publishing state; refer to #STREAM_PUBLISH_STATE for details.
* @param elapseSinceLastState The time in milliseconds from the last state to the current one.
*/
/**
* Reports changes in video dimensions or orientation for a specific user.
*
* @param uid The user's ID (remote or local with 0 as local).
* @param width The new video width in pixels.
* @param height The new video height in pixels.
* @param rotation The new video rotation in degrees [0, 360).
*/
/**
* Notifies about changes in the subscription state of a remote video stream.
*
* @param channel The name of the channel.
* @param uid Identifier of the remote user.
* @param oldState Prior subscription state; refer to #STREAM_SUBSCRIBE_STATE for enumeration values.
* @param newState Current subscription state; refer to #STREAM_SUBSCRIBE_STATE for enumeration values.
* @param elapseSinceLastState Duration in milliseconds from the last state to the current one.
*/
音频观测器。
你可以调用 registerAudioFrameObserver 注册或取消注册 IAudioFrameObserver 音频观测器。
相关参考
/**
* Callback for mixed audio frames, combining captured and playback audio.
* @param audioFrame Reference to the mixed audio frame.
* @return true if the mixed audio frame is valid and should be processed, otherwise false.
* @note This callback provides single-channel data. Ensure the expected format by calling setMixedAudioFrameParameters after
registering
* the observer.
*/
/**
* Callback for audio playback frames.
* @param audioFrame Reference to the audio frame to be played back.
* @return true if the audio frame is valid and should be processed, otherwise false.
* @note Ensure the expected audio frame format by calling setPlaybackAudioFrameParameters after registering the observer.
*/
/**
* Callback for a specified user's audio frame before mixing.
* @param uid User ID of the audio source.
* @param audioFrame Reference to the audio frame from the specified user.
* @return true if the audio frame is valid and should be processed, otherwise false.
* @note This callback is triggered if isMultipleChannelFrameWanted returns false. Ensure the expected format by calling 次
*setPlaybackAudioFrameParameters after registering the observer.
*/
/**
* Callback for capturing audio frames.
* @param audioFrame Reference to the captured audio frame.
* @return true if the audio frame is valid and should be processed, otherwise false.
* @note Ensure the expected audio frame format by calling setRecordingAudioFrameParameters after registering the observer.
*/
视频观测器。
你可以调用 registerVideoFrameObserver 注册或取消注册 IVideoFrameObserver 视频观测器。
相关参考
/**
* Determines whether to mirror the raw video frame.
* @return true to mirror the video frame, false to leave it as-is.
*/
/**
* Sets the frame position for the video observer.
* @return A bit mask that controls the frame position of the video observer from VIDEO_OBSERVER_POSITION.
*/
/**
* Determines whether to rotate the raw video frame according to the rotation member in the VideoFrame class.
* @return true to rotate the video frame, false to leave it as-is.
*/
/**
* Determines the preferred video frame format.
* @return The preferred video frame format from VIDEO_FRAME_TYPE.
*/
/**
* Callback triggered each time the SDK receives a video frame captured by the local camera.
* @param videoFrame Reference to the captured video frame.
* @return true to process the video frame, false to ignore it.
* @note This callback does not support RGBA data and does not include post-processing effects.
*/
/**
* Callback triggered each time the SDK receives a video frame before encoding.
* @param videoFrame Reference to the video frame before encoding.
* @return true to process the video frame, false to ignore it.
* @note This callback includes post-processing effects and requires specific observer positions.
*/
/**
* Callback triggered each time the SDK receives a video frame from a remote user.
* @param uid The user ID of the remote user who sent the video frame.
* @param videoFrame Reference to the received video frame.
* @return true to process the video frame, false to ignore it.
* @note This callback does not support RGBA data.
*/