=============== LIBRARY RULES =============== From library maintainers: - NERTC SDK supports 14+ platforms including Android, iOS, Web, Windows, macOS, Linux, Unity, Unreal Engine, Flutter, Electron, HarmonyOS, and more - Each platform has its own integration guide under guides/[Platform]/ directory - Always check the platform-specific Quick Start guide first: guides/[Platform]/快速开始/ - SDK supports both audio-only and audio-video modes - check integration requirements for each - AI features (noise reduction, super resolution, virtual background) require specific SDK versions and may have platform limitations - For production use, always implement proper error handling and connection state management - Refer to platform-specific Best Practices section for optimization recommendations - Cross-platform features may have different API names - check platform-specific documentation - When implementing custom audio/video capture, ensure proper device permission handling - For multi-room scenarios, check if the platform supports the multi-room management feature ### Engine Initialization and Setup Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/iOS/doxygen/Latest/en/html/functions_func_s.html Methods related to the initialization and setup of the NERtcEngine. ```APIDOC ## POST /api/engine/setup ### Description Handles the initialization and setup of the NERtcEngine instance. ### Method POST ### Endpoint /api/engine/setup ### Parameters #### Request Body - **methodName** (string) - Required - The name of the engine setup method to call (e.g., `setupEngineWithContext`, `sharedEngine`). - **parameters** (object) - Required - An object containing the parameters for the specified method. ### Request Example ```json { "methodName": "setupEngineWithContext", "parameters": { "context": "", "engine": "" } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success or failure of the operation. - **message** (string) - Provides details about the operation result. #### Response Example ```json { "status": "success", "message": "NERtcEngine setup completed." } ``` ``` -------------------------------- ### Handle User Audio Start (Java) Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/android/doxygen/Latest/en/html/interfacecom_1_1netease_1_1lava_1_1nertc_1_1sdk_1_1_n_e_rtc_callback_ex.html Callback invoked when a user starts sending audio. It provides the user ID of the user who started sending audio. ```java void onUserAudioStart(long uid) ``` -------------------------------- ### Start Audio Recording with Configuration Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/windows/doxygen/Latest/en/html/functions_s.html Starts recording the audio stream with specified configurations. This function is available on the IRtcEngineEx interface. ```cpp NEResult startAudioRecordingWithConfig(const char* path, const nertc::AudioRecordingConfiguration& config); NEResult startAudioRecordingWithConfig(const char* path, const nertc::AudioRecordingConfiguration& config); ``` -------------------------------- ### Handle User Audio Start Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/macOS/doxygen/Latest/en/html/classnertc_1_1_i_rtc_engine_event_handler_ex.html Callback invoked when a remote user starts sending audio streams. It provides the user ID of the user who started sending audio. ```cpp virtual void onUserAudioStart(uid_t uid) = 0; ``` -------------------------------- ### Handle User Sub Stream Audio Start (Java) Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/android/doxygen/Latest/en/html/interfacecom_1_1netease_1_1lava_1_1nertc_1_1sdk_1_1_n_e_rtc_callback_ex.html Callback invoked when a user starts their substream audio. It provides the user ID of the user who started the audio. ```java void onUserSubStreamAudioStart(long uid) ``` -------------------------------- ### Start Audio Dump (C++) Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/macOS/doxygen/Latest/zh/html/classnertc_1_1_i_rtc_engine_ex-members.html Initiates the audio dumping process. Supports starting without parameters or specifying an audio dump type. ```cpp virtual int startAudioDump() = 0; virtual int startAudioDump(NERtcAudioDumpType type) = 0; ``` -------------------------------- ### Installation Constants Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/windows/doxygen/Latest/en/html/namespacemembers_k.html Constants related to the status and results of installing cast audio drivers. ```APIDOC ## Installation Constants ### Description Constants indicating the status of cast audio driver installation. ### kNERtcInstallCastAudioDriverFailed * **Description**: Indicates a failure during the cast audio driver installation. ### kNERtcInstallCastAudioDriverNotAuthorized * **Description**: Indicates that the installation failed due to lack of authorization. ### kNERtcInstallCastAudioDriverSuccess * **Description**: Indicates that the cast audio driver was successfully installed. ``` -------------------------------- ### Start Audio Recording with Configuration (C++) Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/windows/doxygen/Latest/en/html/classnertc_1_1_i_rtc_engine_ex.html Starts recording audio streams from a room locally. Supports WAV for high quality and AAC for low quality. The method must be called after joining a channel. A client can only run one recording task at a time. If the user leaves the room, recording stops automatically. Parameters include file path, sample rate, quality, position, and cycle time. Returns 0 on success, other values on failure. ```cpp virtual int nertc::IRtcEngineEx::startAudioRecordingWithConfig( const NERtcAudioRecordingConfiguration & _config_ ) ``` -------------------------------- ### Start Last-Mile Network Probe Test Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/android/doxygen/Latest/en/html/classcom_1_1netease_1_1lava_1_1nertc_1_1sdk_1_1_n_e_rtc_ex.html Starts the last-mile network probe test before joining a channel to get uplink and downlink network statistics. This helps in estimating network quality before a call. ```APIDOC ## POST /startLastmileProbeTest ### Description Starts the last-mile network probe test before joining a channel to get the uplink and downlink last mile network statistics, including bandwidth, packet loss, jitter, and round-trip time (RTT). This method is used to detect network quality before a call. ### Method POST ### Endpoint /startLastmileProbeTest ### Parameters #### Query Parameters - **config** (LastmileProbeConfig) - Required - Sets the configurations of the last-mile network probe test. ### Request Example ```json { "config": { ... } } ``` ### Response #### Success Response (200) - **result** (int) - Indicates the result of the operation. 0 for success. #### Response Example ```json { "result": 0 } ``` ### Notes - You can call this method before joining a channel (`joinChannel`). - Do not call other methods before receiving the `onLastmileQuality` and `onLastmileProbeResult` callbacks. Otherwise, the callbacks may be interrupted. - Available since V4.5.0. ``` -------------------------------- ### Receive Notification for Audio Driver Installation Result (Mac) Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/macOS/doxygen/Latest/en/html/classnertc_1_1_i_rtc_engine_event_handler_ex.html Callback to get notified about the result of attempting to install the audio driver plug-in on macOS. This is necessary for capturing and playing audio system data. ```c++ virtual void nertc::IRtcEngineEventHandlerEx::onCheckNECastAudioDriverResult(NERtcInstallCastAudioDriverResult result) { // Handle the result of the audio driver installation attempt // result: Indicates the success or failure of the installation. } ``` -------------------------------- ### switchCamera() - NERtcEx Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/android/doxygen/Latest/en/html/classcom_1_1netease_1_1lava_1_1nertc_1_1sdk_1_1_n_e_rtc_ex.html Switches between the front and rear cameras. This method should be called after the camera has started, for example, after calling startVideoPreview or joinChannel. ```APIDOC ## switchCamera() ### Description Switches between the front and rear cameras. ### Method ABSTRACT ### Endpoint com.netease.lava.nertc.sdk.NERtcEx.switchCamera ### Parameters ### Request Example ```json { "method": "switchCamera" } ``` ### Response #### Success Response (0) - `0` (int) - Indicates the method call was successful. #### Response Example ```json { "resultCode": 0 } ``` ``` -------------------------------- ### startVideoPreview Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/windows/doxygen/Latest/en/html/classnertc_1_1_i_rtc_engine_ex.html Enables local video preview before joining a room. Requires setupLocalVideoCanvas to be called prior to joining the room. ```APIDOC ## POST /api/startVideoPreview ### Description Enables local video preview before joining a room. Requires `setupLocalVideoCanvas` to be called prior to joining the room. ### Method POST ### Endpoint /api/startVideoPreview ### Parameters None ### Request Body None ### Response #### Success Response (200) - **code** (int) - 0 for success, other values for failure. #### Response Example ```json { "code": 0 } ``` ``` -------------------------------- ### startRecording() Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/wwise/doxygen/Latest/zh/Unity/html/classnertc_1_1wwiseplugin_1_1_i_voice_engine_native.html Starts a new audio recording session. ```APIDOC ## POST /voice-engine/recording/start ### Description Begins a new audio recording session, saving the audio data to the specified file path. ### Method POST ### Endpoint /voice-engine/recording/start ### Parameters #### Request Body - **filePath** (string) - Required - The path where the recorded audio will be saved. ### Request Example ```json { "filePath": "/recordings/session1.wav" } ``` ### Response #### Success Response (200) - **status** (int) - Indicates the success of starting the recording (e.g., 0 for success). #### Response Example ```json { "status": 0 } ``` ``` -------------------------------- ### NERtc: Switch Camera Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/iOS/doxygen/Latest/en/html/protocol_i_n_e_rtc_engine-p.html Switches between the front and rear cameras. This method should be called after the camera has started, for example, after calling `startPreview` or `joinChannel`. ```APIDOC ## POST /switchCamera ### Description Switches between the front and rear cameras. Ensure this method is called after the camera starts (e.g., after `startPreview` or `joinChannel`). **Note:** The audio-only SDK disables this API. ### Method POST ### Endpoint /switchCamera ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **code** (integer) - 0 indicates success. A value less than 0 indicates failure. #### Response Example ```json { "code": 0 } ``` ``` -------------------------------- ### Audio Mixing Management Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/iOS/doxygen/Latest/en/html/index.html APIs for controlling the playback of music files, including starting, stopping, pausing, resuming, setting volume, and getting playback information. ```APIDOC ## INERtcEngineEx#startAudioMixingWithOption ### Description Starts to play a music file with specified options. ### Method POST (Implied, as it starts a process) ### Endpoint /audio/mixing/start ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **filePath** (string) - Required - The path to the music file. - **loopCount** (integer) - Optional - The number of times to loop the playback. - **startTime** (integer) - Optional - The start position in milliseconds. ### Request Example ```json { "filePath": "/path/to/your/music.mp3", "loopCount": 1, "startTime": 0 } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## INERtcEngineEx#stopAudioMixing ### Description Stops playing the currently playing music file. ### Method POST ### Endpoint /audio/mixing/stop ### Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## INERtcEngineEx#pauseAudioMixing ### Description Pauses the playback of the currently playing music file. ### Method POST ### Endpoint /audio/mixing/pause ### Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## INERtcEngineEx#resumeAudioMixing ### Description Resumes the playback of a paused music file. ### Method POST ### Endpoint /audio/mixing/resume ### Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## INERtcEngineEx#setAudioMixingPlaybackVolume ### Description Sets the playback volume for the music file. ### Method POST ### Endpoint /audio/mixing/playback-volume ### Parameters #### Query Parameters - **volume** (integer) - Required - The playback volume, typically from 0 to 100. ### Request Example ```json { "volume": 80 } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## INERtcEngineEx#setAudioMixingSendVolume ### Description Sets the volume at which the music file is published along with the microphone audio. ### Method POST ### Endpoint /audio/mixing/send-volume ### Parameters #### Query Parameters - **volume** (integer) - Required - The publishing volume, typically from 0 to 100. ### Request Example ```json { "volume": 60 } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## INERtcEngineEx#getAudioMixingPlaybackVolume ### Description Gets the current playback volume of the music file. ### Method GET ### Endpoint /audio/mixing/playback-volume ### Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **volume** (integer) - The current playback volume. #### Response Example ```json { "volume": 80 } ``` ``` ```APIDOC ## INERtcEngineEx#getAudioMixingSendVolume ### Description Gets the current publishing volume of the music file. ### Method GET ### Endpoint /audio/mixing/send-volume ### Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **volume** (integer) - The current publishing volume. #### Response Example ```json { "volume": 60 } ``` ``` ```APIDOC ## INERtcEngineEx#getAudioMixingDuration ### Description Gets the total duration of the music file in milliseconds. ### Method GET ### Endpoint /audio/mixing/duration ### Parameters #### Query Parameters - **filePath** (string) - Required - The path to the music file. ### Request Example ```json { "filePath": "/path/to/your/music.mp3" } ``` ### Response #### Success Response (200) - **duration** (integer) - The total duration of the music file in milliseconds. #### Response Example ```json { "duration": 180000 } ``` ``` ```APIDOC ## INERtcEngineEx#setAudioMixingPosition ### Description Sets the playback position of the music file to a specified time in milliseconds. ### Method POST ### Endpoint /audio/mixing/position ### Parameters #### Query Parameters - **position** (integer) - Required - The desired playback position in milliseconds. ### Request Example ```json { "position": 60000 } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## INERtcEngineEx#getAudioMixingCurrentPosition ### Description Gets the current playback position of the music file in milliseconds. ### Method GET ### Endpoint /audio/mixing/current-position ### Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **position** (integer) - The current playback position in milliseconds. #### Response Example ```json { "position": 60000 } ``` ``` -------------------------------- ### Start Audio Recording (Simplified - C++) Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/windows/doxygen/Latest/en/html/classnertc_1_1_i_rtc_engine_ex.html Starts audio recording with a specified file path, sample rate, and audio quality. The recording file can be in WAV (large, high quality) or AAC (small, low quality) format. This method must be called after joining a room. Repeated calls will stop the current recording and start a new one. Leaving the room stops recording automatically, but it can also be stopped manually using stopAudioRecording. Parameters include file path, sample rate, and quality. Returns 0 on success, other values on failure. ```cpp virtual int nertc::IRtcEngineEx::startAudioRecording( const char * file_path, int sample_rate, NERtcAudioRecordingQuality quality ) ``` -------------------------------- ### Start Audio Recording (Java) Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/android/doxygen/Latest/en/html/classcom_1_1netease_1_1lava_1_1nertc_1_1sdk_1_1_n_e_rtc_ex.html Starts recording the mixed audio from all room members and saves it locally. The recording format depends on the quality parameter (WAV for high quality, AAC for low quality). Returns 0 on success, non-zero on failure. Can only be called after joining a room. ```java int startAudioRecording(String filePath, int sampleRate, int quality); ``` -------------------------------- ### NERtcBeauty Singleton and Initialization Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/iOS/doxygen/Latest/en/html/_n_e_rtc_beauty_8h_source.html Provides methods to get the singleton instance of NERtcBeauty, start, and stop beauty processing. ```APIDOC ## NERtcBeauty Singleton and Initialization ### Description Provides methods to get the singleton instance of NERtcBeauty, start, and stop beauty processing. ### Method - `+ (NERtcBeauty *)shareInstance` - `- (int)startBeauty` - `- (void)stopBeauty` ### Endpoint N/A (This is a class/instance method documentation) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```objectivec // Get the singleton instance NERtcBeauty *beautyManager = [NERtcBeauty shareInstance]; // Start beauty processing [beautyManager startBeauty]; // Stop beauty processing [beautyManager stopBeauty]; ``` ### Response #### Success Response (200) - `shareInstance`: Returns an instance of `NERtcBeauty`. - `startBeauty`: Returns an integer status code (0 for success). - `stopBeauty`: void #### Response Example ```json { "message": "Beauty processing started successfully" } ``` ```json { "message": "Beauty processing stopped" } ``` ``` -------------------------------- ### Start Remote Sub-Stream Video - C++ NERTC Source: https://github.com/netease-kit/nertc_doc_source/blob/main/guides/Windows/快速开始/实现音视频通话.md Handles the event when a remote user starts sharing a sub-stream video (e.g., screen sharing). It creates a dialog, sets up the canvas for the sub-stream, and subscribes to it. Dependencies include CvideoDlg, NERtcVideoCanvas, and nertc::IRtcEngineEx. ```cpp LRESULT CmainWindow::OnUserSubStreamVideoStart(WPARAM wParam, LPARAM lParam) { LPNERtcUserInfo lpData = (LPNERtcUserInfo)wParam; if (_remote_sub_video.end() == _remote_sub_video.find(lpData->uid)) { CvideoDlg * pdlg = new CvideoDlg(); pdlg->Create(IDD_DIALOG1_VIDEO); pdlg->ShowWindow(SW_HIDE); _remote_sub_video[lpData->uid] = pdlg; HWND hwd = pdlg->GetDlgItem(IDC_REMOTE_VIDEO)->m_hWnd; nertc::NERtcVideoCanvas canvas; canvas.cb = nullptr; canvas.user_data = nullptr; canvas.window = hwd; //设置远端用户视频辅流画布 rtc_engine_->setupRemoteSubStreamVideoCanvas(lpData->uid, &canvas); } //订阅远端用户视频辅流 int ret = rtc_engine_->subscribeRemoteVideoSubStream(lpData->uid, true); _remote_sub_video[lpData->uid]->ShowWindow(SW_SHOWNORMAL); return 0; } ``` -------------------------------- ### startAudioRecording() Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/android/doxygen/Latest/en/html/classcom_1_1netease_1_1lava_1_1nertc_1_1sdk_1_1_n_e_rtc_ex.html Starts recording the mixed audio from all room members and saves it locally. Supports WAV (high quality, large file) and AAC (low quality, small file) formats. ```APIDOC ## POST /startAudioRecording ### Description Starts recording the mixed audio from all room members and saves it locally. Supports WAV (high quality, large file) and AAC (low quality, small file) formats. The onAudioRecording() callback is triggered when recording starts or ends. ### Method POST ### Endpoint /startAudioRecording ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **filePath** (String) - Required - The file path for saving the recording. Must include filename and format (e.g., sdcard/xxx/audio.aac). Supports WAV or AAC formats. - **sampleRate** (int) - Required - The audio sample rate. Valid values: 16000, 32000, 44100, 48000. Default is 32000. - **quality** (int) - Optional - The audio quality. Only applicable for AAC format. Refer to `NERtcConstants.AudioRecordingQuality` for values. ### Request Example ```json { "filePath": "/sdcard/recording.aac", "sampleRate": 44100, "quality": 1 } ``` ### Response #### Success Response (200) - **int** - 0 indicates success, otherwise failure. #### Response Example ```json { "result": 0 } ``` ``` -------------------------------- ### Start Remote Video Stream - C++ NERTC Source: https://github.com/netease-kit/nertc_doc_source/blob/main/guides/Windows/快速开始/实现音视频通话.md Handles the event when a remote user starts streaming video. It creates a new video dialog, sets up the remote video canvas, and subscribes to the video stream. Dependencies include CvideoDlg, NERtcVideoCanvas, and nertc::IRtcEngineEx. ```cpp LRESULT CmainWindow::OnUserVideoStart(WPARAM wParam, LPARAM lParam) { LPNERtcUserInfo lpData = (LPNERtcUserInfo)wParam; if (_remote_video.end() == _remote_video.find(lpData->uid)) { CvideoDlg * p_remote_video_dlg = new CvideoDlg(); p_remote_video_dlg->Create(IDD_DIALOG1_VIDEO); p_remote_video_dlg->ShowWindow(SW_HIDE); _remote_video[lpData->uid] = p_remote_video_dlg; HWND hwd = p_remote_video_dlg->GetDlgItem(IDC_REMOTE_VIDEO)->m_hWnd; nertc::NERtcVideoCanvas canvas; canvas.cb = nullptr; canvas.user_data = nullptr; canvas.window = hwd; //设置远端用户视频画布 rtc_engine_->setupRemoteVideoCanvas(&canvas); } //订阅远端用户视频流 rtc_engine_->subscribeRemoteVideoStream(lpData->uid, nertc::kNERtcRemoteVideoStreamTypeHigh, true); _remote_video[lpData->uid]->ShowWindow(SW_SHOWNORMAL); return 0; } ``` -------------------------------- ### SDK Initialization and Logging Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/android/doxygen/Latest/zh/html/functions_i.html Information on initializing the SDK and setting log levels. ```APIDOC ## SDK Initialization and Logging ### Description This section covers methods for initializing the NERTC SDK and configuring logging behavior. ### Initialization - **init()** (com.netease.lava.nertc.sdk.NERtc, com.netease.lava.nertc.sdk.NERtcLinkEngine): Initializes the NERTC SDK or the Link Engine. - **initSpatializer()** (com.netease.lava.nertc.sdk.channel.NERtcChannel, com.netease.lava.nertc.sdk.NERtcEx): Initializes the spatial audioizer for a channel or extended features. ### Logging - **INFO** (com.netease.lava.nertc.sdk.NERtcConstants.LogLevel): Represents the INFO log level. ### Error Codes - **INIT_ERROR** (com.netease.lava.nertc.sdk.NERtcConstants.AudioDeviceState): Indicates an initialization error related to audio devices. ``` -------------------------------- ### NERtc - startAudioRecording Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/windows/doxygen/Latest/en/html/classnertc_1_1_i_rtc_engine_ex.html Starts recording audio streams mixed from all users on the client and saves them to a local file. The onAudioRecording() callback is triggered when recording starts or ends. ```APIDOC ## POST /audio/recording/start ### Description Starts an audio recording on a client. The client records mixed audio streams from all users and stores them in a local file. ### Method POST ### Endpoint /audio/recording/start ### Parameters #### Query Parameters - **file_path** (string) - Required - The path where the audio recording file will be saved. - **sample_rate** (int) - Required - The sample rate for the audio recording. - **quality** (NERtcAudioRecordingQuality) - Required - The quality of the audio recording. ### Request Example ```json { "file_path": "/path/to/recording.wav", "sample_rate": 44100, "quality": "kNERtcAudioRecordingQualityMedium" } ``` ### Response #### Success Response (200) - **code** (int) - 0 for success, other values for failure. #### Response Example ```json { "code": 0 } ``` ``` -------------------------------- ### Effect Management Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/linux/doxygen/Latest/zh/html/nertc__engine__ex_8h_source.html APIs for managing audio effects, including getting current position, duration, starting, stopping, resuming, and setting send volume. ```APIDOC ## getEffectCurrentPosition ### Description Gets the current playback position of an audio effect. ### Method GET (Implied, as it's a getter function) ### Endpoint Not applicable (C++ method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```cpp uint64_t effect_id = 123; uint64_t timestamp_ms; int result = rtcEngine->getEffectCurrentPosition(effect_id, ×tamp_ms); ``` ### Response #### Success Response (0) Returns 0 on success. The `timestamp_ms` parameter will be updated with the current playback position. #### Response Example ```cpp // On success, timestamp_ms will contain the playback position in milliseconds. ``` --- ## getEffectDuration ### Description Gets the total duration of an audio effect. ### Method GET (Implied, as it's a getter function) ### Endpoint Not applicable (C++ method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```cpp uint64_t effect_id = 123; uint64_t duration_ms; int result = rtcEngine->getEffectDuration(effect_id, &duration_ms); ``` ### Response #### Success Response (0) Returns 0 on success. The `duration_ms` parameter will be updated with the effect's duration. #### Response Example ```cpp // On success, duration_ms will contain the effect duration in milliseconds. ``` --- ## addBeautyMakeup ### Description Applies a beauty makeup effect using a specified file. ### Method POST (Implied, as it modifies state) ### Endpoint Not applicable (C++ method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **file_path** (const char*) - Required - The path to the makeup file. ### Request Example ```cpp const char* makeup_file = "/path/to/makeup.zip"; int result = rtcEngine->addBeautyMakeup(makeup_file); ``` ### Response #### Success Response (0) Returns 0 on success. #### Response Example ```cpp // Success indication. ``` --- ## setEffectSendVolume ### Description Sets the playback volume for a specific audio effect. ### Method PUT (Implied, as it modifies state) ### Endpoint Not applicable (C++ method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **effect_id** (uint32_t) - Required - The ID of the effect. - **volume** (uint32_t) - Required - The desired volume level (0-100). ### Request Example ```cpp uint32_t effect_id = 123; uint32_t volume = 80; int result = rtcEngine->setEffectSendVolume(effect_id, volume); ``` ### Response #### Success Response (0) Returns 0 on success. #### Response Example ```cpp // Success indication. ``` --- ## resumeEffect ### Description Resumes a paused audio effect. ### Method POST (Implied, as it modifies state) ### Endpoint Not applicable (C++ method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **effect_id** (uint32_t) - Required - The ID of the effect to resume. ### Request Example ```cpp uint32_t effect_id = 123; int result = rtcEngine->resumeEffect(effect_id); ``` ### Response #### Success Response (0) Returns 0 on success. #### Response Example ```cpp // Success indication. ``` --- ## stopEffect ### Description Stops the playback of an audio effect. ### Method DELETE (Implied, as it stops a process) ### Endpoint Not applicable (C++ method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **effect_id** (uint32_t) - Required - The ID of the effect to stop. ### Request Example ```cpp uint32_t effect_id = 123; int result = rtcEngine->stopEffect(effect_id); ``` ### Response #### Success Response (0) Returns 0 on success. #### Response Example ```cpp // Success indication. ``` ``` -------------------------------- ### Start Screen Capture (Objective-C) Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/iOS/doxygen/Latest/zh/html/interface_n_e_rtc_channel-members.html Initiates screen capture for sharing. This allows the user to broadcast their screen content. It requires a screen capture configuration object. ```objectivec - (void)startScreenCapture:(NERtcScreenCaptureConfiguration *)configuration; ``` -------------------------------- ### Screen Capture API Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/windows/doxygen/Latest/zh/html/classnertc_1_1_i_rtc_engine_ex.html APIs for capturing screen content, including getting available sources, starting capture by different methods, and updating capture parameters. ```APIDOC ## GET /rtc/getScreenCaptureSources ### Description Retrieves a list of available screen capture sources (e.g., displays, windows). ### Method GET ### Endpoint /rtc/getScreenCaptureSources ### Parameters #### Query Parameters - **thumbSize** (NERtcSize) - Required - The desired size for thumbnail images of the sources. - **iconSize** (NERtcSize) - Required - The desired size for icon images of the sources. - **includeScreen** (boolean) - Required - Whether to include entire screens in the list of sources. ### Request Example ```json { "thumbSize": {"width": 160, "height": 90}, "iconSize": {"width": 32, "height": 32}, "includeScreen": true } ``` ### Response #### Success Response (200) - **sources** (IScreenCaptureSourceList) - A list of available screen capture sources. #### Response Example ```json { "sources": [ { "sourceId": "display_1", "name": "Screen 1", "type": "display", "thumbnailUrl": "data:image/png;base64,..." }, { "sourceId": "window_123", "name": "My Application", "type": "window", "thumbnailUrl": "data:image/png;base64,..." } ] } ``` ## POST /rtc/startScreenCaptureByScreenRect ### Description Starts screen capture for a specific rectangular area of the screen. ### Method POST ### Endpoint /rtc/startScreenCaptureByScreenRect ### Parameters #### Query Parameters - **screen_rect** (NERtcRectangle) - Required - The rectangle defining the screen area to capture. - **region_rect** (NERtcRectangle) - Required - The rectangle defining the region within the screen area to capture. - **capture_params** (NERtcScreenCaptureParameters) - Required - Parameters for the screen capture. ### Request Example ```json { "screen_rect": {"x": 0, "y": 0, "width": 1920, "height": 1080}, "region_rect": {"x": 100, "y": 100, "width": 800, "height": 600}, "capture_params": {"frameRate": 30, "bitrate": 5000} } ``` ### Response #### Success Response (200) - **code** (int) - Indicates the success or failure of the operation. 0 for success, non-zero for failure. #### Response Example ```json { "code": 0 } ``` ## POST /rtc/startScreenCaptureByDisplayId ### Description Starts screen capture for a specific display identified by its ID. ### Method POST ### Endpoint /rtc/startScreenCaptureByDisplayId ### Parameters #### Query Parameters - **display_id** (source_id_t) - Required - The ID of the display to capture. - **region_rect** (NERtcRectangle) - Required - The rectangle defining the region within the display to capture. - **capture_params** (NERtcScreenCaptureParameters) - Required - Parameters for the screen capture. ### Request Example ```json { "display_id": "display_1", "region_rect": {"x": 0, "y": 0, "width": 1920, "height": 1080}, "capture_params": {"frameRate": 30, "bitrate": 5000} } ``` ### Response #### Success Response (200) - **code** (int) - Indicates the success or failure of the operation. 0 for success, non-zero for failure. #### Response Example ```json { "code": 0 } ``` ## POST /rtc/startScreenCaptureByWindowId ### Description Starts screen capture for a specific window identified by its ID. ### Method POST ### Endpoint /rtc/startScreenCaptureByWindowId ### Parameters #### Query Parameters - **window_id** (source_id_t) - Required - The ID of the window to capture. - **region_rect** (NERtcRectangle) - Required - The rectangle defining the region within the window to capture. - **capture_params** (NERtcScreenCaptureParameters) - Required - Parameters for the screen capture. ### Request Example ```json { "window_id": "window_123", "region_rect": {"x": 0, "y": 0, "width": 800, "height": 600}, "capture_params": {"frameRate": 30, "bitrate": 5000} } ``` ### Response #### Success Response (200) - **code** (int) - Indicates the success or failure of the operation. 0 for success, non-zero for failure. #### Response Example ```json { "code": 0 } ``` ## POST /rtc/setScreenCaptureSource ### Description Sets the screen capture source and region, along with capture parameters. ### Method POST ### Endpoint /rtc/setScreenCaptureSource ### Parameters #### Query Parameters - **source** (NERtcScreenCaptureSourceInfo) - Required - Information about the screen capture source. - **region_rect** (NERtcRectangle) - Required - The rectangle defining the region to capture. - **capture_params** (NERtcScreenCaptureParameters) - Required - Parameters for the screen capture. ### Request Example ```json { "source": {"sourceId": "display_1", "type": "display"}, "region_rect": {"x": 0, "y": 0, "width": 1920, "height": 1080}, "capture_params": {"frameRate": 30, "bitrate": 5000} } ``` ### Response #### Success Response (200) - **code** (int) - Indicates the success or failure of the operation. 0 for success, non-zero for failure. #### Response Example ```json { "code": 0 } ``` ## POST /rtc/updateScreenCaptureRegion ### Description Updates the capture region for an ongoing screen capture. ### Method POST ### Endpoint /rtc/updateScreenCaptureRegion ### Parameters #### Query Parameters - **region_rect** (NERtcRectangle) - Required - The new rectangle defining the capture region. ### Request Example ```json { "region_rect": {"x": 100, "y": 100, "width": 900, "height": 700} } ``` ### Response #### Success Response (200) - **code** (int) - Indicates the success or failure of the operation. 0 for success, non-zero for failure. #### Response Example ```json { "code": 0 } ``` ## POST /rtc/setScreenCaptureMouseCursor ### Description Configures whether to capture the mouse cursor during screen recording. ### Method POST ### Endpoint /rtc/setScreenCaptureMouseCursor ### Parameters #### Query Parameters - **capture_cursor** (boolean) - Required - Set to true to capture the mouse cursor, false otherwise. ### Request Example ```json { "capture_cursor": true } ``` ### Response #### Success Response (200) - **code** (int) - Indicates the success or failure of the operation. 0 for success, non-zero for failure. #### Response Example ```json { "code": 0 } ``` ## POST /rtc/stopScreenCapture ### Description Stops the current screen capture session. ### Method POST ### Endpoint /rtc/stopScreenCapture ### Parameters None ### Response #### Success Response (200) - **code** (int) - Indicates the success or failure of the operation. 0 for success, non-zero for failure. #### Response Example ```json { "code": 0 } ``` ## POST /rtc/pauseScreenCapture ### Description Pauses the current screen capture session. ### Method POST ### Endpoint /rtc/pauseScreenCapture ### Parameters None ### Response #### Success Response (200) - **code** (int) - Indicates the success or failure of the operation. 0 for success, non-zero for failure. #### Response Example ```json { "code": 0 } ``` ## POST /rtc/resumeScreenCapture ### Description Resumes a paused screen capture session. ### Method POST ### Endpoint /rtc/resumeScreenCapture ### Parameters None ### Response #### Success Response (200) - **code** (int) - Indicates the success or failure of the operation. 0 for success, non-zero for failure. #### Response Example ```json { "code": 0 } ``` ## POST /rtc/setExcludeWindowList ### Description Sets a list of windows to exclude from screen capture. ### Method POST ### Endpoint /rtc/setExcludeWindowList ### Parameters #### Query Parameters - **window_list** (array of source_id_t) - Required - An array of window IDs to exclude. - **count** (int) - Required - The number of elements in the window_list. ### Request Example ```json { "window_list": ["window_abc", "window_def"], "count": 2 } ``` ### Response #### Success Response (200) - **code** (int) - Indicates the success or failure of the operation. 0 for success, non-zero for failure. #### Response Example ```json { "code": 0 } ``` ## POST /rtc/updateScreenCaptureParameters ### Description Updates the parameters for an ongoing screen capture session. ### Method POST ### Endpoint /rtc/updateScreenCaptureParameters ### Parameters #### Query Parameters - **captureParams** (NERtcScreenCaptureParameters) - Required - The new parameters for screen capture. ### Request Example ```json { "captureParams": {"frameRate": 60, "bitrate": 8000} } ``` ### Response #### Success Response (200) - **code** (int) - Indicates the success or failure of the operation. 0 for success, non-zero for failure. #### Response Example ```json { "code": 0 } ``` ``` -------------------------------- ### Start Screen Capture Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/android/doxygen/Latest/en/html/classcom_1_1netease_1_1lava_1_1nertc_1_1sdk_1_1_n_e_rtc_ex.html Initiates screen capture. Requires user permission via MediaProjection. This method is abstract and requires an implementation within the NERtcEx SDK. ```java /** * Starts screen capture. * @param screenConfig Configuration for screen capture. * @param mediaProjectionPermissionResultData Intent data received after permission grant. * @param mediaProjectionCallback Callback for MediaProjection events. * @return An integer indicating the result of the operation. */ abstract int startScreenCapture(NERtcScreenConfig screenConfig, Intent mediaProjectionPermissionResultData, MediaProjection.Callback mediaProjectionCallback); ``` -------------------------------- ### Get Source Media Info for NERtc Relay Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/android/doxygen/Latest/en/html/classcom_1_1netease_1_1lava_1_1nertc_1_1sdk_1_1_n_e_rtc_media_relay_param_1_1_channel_media_relay_configuration.html Retrieves information about the source channels configured for media relaying in NERtc. This is typically used to inspect the current relay setup. ```java ChannelMediaRelayInfo srcInfo = configuration.getSrcMediaInfo(); ``` -------------------------------- ### Start Screen Capture by Screen Region (C++) Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/macOS/doxygen/Latest/en/html/classnertc_1_1_i_rtc_channel.html Initiates screen sharing by specifying a screen region. This method is applicable only to Windows and enables video substreams. It requires defining the screen area and capture parameters. Callbacks onUserSubStreamVideoStart and setExcludeWindowList are triggered upon successful execution. ```cpp virtual int nertc::IRtcChannel::startScreenCaptureByScreenRect( const NERtcRectangle & _screen_rect, const NERtcRectangle & _region_rect, const NERtcScreenCaptureParameters & _capture_params ) pure virtual; // Parameters: // screen_rect: The relative position of the screen to virtual screens that is shared. // region_rect: The relative position of shared screen to the full screen. If you set the shared region beyond the frame of the screen, only content within the screen is shared. If you set the value of width or height as 0, the full screen is shared. // capture_params: The configurations of screen sharing. // Returns: // 0: Success. // Other values: Failure. ``` -------------------------------- ### Channel Media Relay Control Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/android/doxygen/Latest/zh/html/classcom_1_1netease_1_1lava_1_1nertc_1_1sdk_1_1channel_1_1_n_e_rtc_channel.html Manages the channel media relay functionality. Includes starting, updating, stopping, pausing, and resuming the relay. Requires a ChannelMediaRelayConfiguration object for setup and updates. Returns an integer status code for each operation. ```java abstract int startChannelMediaRelay(NERtcMediaRelayParam.ChannelMediaRelayConfiguration config); ``` ```java abstract int updateChannelMediaRelay(NERtcMediaRelayParam.ChannelMediaRelayConfiguration config); ``` ```java abstract int stopChannelMediaRelay(); ``` ```java abstract int pauseChannelMediaRelay(); ``` ```java abstract int resumeChannelMediaRelay(); ``` -------------------------------- ### NERTC Video Start with Back Camera Constant (Objective-C) Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/iOS/doxygen/Latest/en/html/_n_e_rtc_engine_base_8h.html Defines a constant to specify whether to enable the rear camera when video is initialized. The default value is NO. This constant is typically used during the initial setup of video capture in NERTC applications. ```objectivec NSString* const kNERtcKeyVideoStartWithBackCamera; // Default value is NO. ``` -------------------------------- ### Setup Engine with Context Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/iOS/doxygen/Latest/zh/html/functions_func_s.html Initializes the NERtc Engine with a provided context, essential for engine functionality. ```APIDOC ## POST /rtc/engine/setup ### Description Initializes the NERtc Engine with a given context. ### Method POST ### Endpoint `/rtc/engine/setup` ### Parameters #### Request Body - **context** (object) - Required - The context object for engine setup. - **appKey** (string) - Required - The application key. - **contextData** (any) - Required - The platform-specific context data. ### Request Example ```json { "context": { "appKey": "YOUR_APP_KEY", "contextData": "platform_specific_context" } } ``` ### Response #### Success Response (200) - **message** (string) - Success message indicating the engine has been set up. #### Response Example ```json { "message": "NERtc Engine setup with context successful." } ``` ``` -------------------------------- ### Setup Engine with Context (Objective-C) Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/iOS/doxygen/Latest/zh/html/interface_n_e_rtc_engine-members.html Initializes the NERtc engine with the provided context. This is typically the first step required before using other SDK functionalities. ```Objective-C - (NERtcErrorCode)setupEngineWithContext:(UIApplicationContext)context; ``` -------------------------------- ### Check Camera Exposure Support (Java) Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/android/doxygen/Latest/en/html/classcom_1_1netease_1_1lava_1_1nertc_1_1sdk_1_1_n_e_rtc_ex.html Determines if the camera's manual exposure position adjustment is supported by the device. This check should be performed after the camera has started, for example, after calling `startVideoPreview` or `joinChannel`. It returns `true` if supported, `false` otherwise. ```Java public abstract boolean isCameraExposurePositionSupported(); ``` -------------------------------- ### RecordStartOptions Interface Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/web/typedoc/Latest/zh/html/interfaces/types.recordstartoptions.html The RecordStartOptions interface defines the configuration options for starting a recording. ```APIDOC ## Interface RecordStartOptions ### Description Defines the configuration options for starting a recording. ### Properties #### uid - **uid** (string | number) - Required - The unique identifier for the user. #### type - **type** (string) - Required - The type of recording. #### stream - **stream** (MediaStream | MediaStream[]) - Required - The media stream(s) to record. #### reset - **reset** (boolean) - Optional - Whether to reset the recording. ``` -------------------------------- ### Get Maximum Camera Zoom Scale (Objective-C) Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/iOS/doxygen/Latest/en/html/protocol_i_n_e_rtc_engine_ex-p.html Retrieves the maximum zoom ratio supported by the device's camera. Call this method after starting the camera. The audio-only SDK disables this API. ```Objective-C - (float) maxCameraZoomScale; ``` -------------------------------- ### Start Channel Media Relay (C++) Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/windows/doxygen/Latest/en/html/classnertc_1_1_i_rtc_engine_ex.html Starts relaying media streams across different rooms, enabling co-hosting scenarios. This method allows media streams from up to four rooms to be relayed, and a room can receive multiple relayed streams. It requires a NERtcChannelMediaRelayConfiguration object as input. The return value indicates success (0) or failure. ```cpp virtual int nertc::IRtcEngineEx::startChannelMediaRelay( NERtcChannelMediaRelayConfiguration * config ) ``` -------------------------------- ### Control NERTC Playback Streaming Source: https://github.com/netease-kit/nertc_doc_source/blob/main/api-reference/macOS/doxygen/Latest/zh/html/classnertc_1_1_i_rtc_engine_ex.html Functions to manage the playback of network streams. This includes setup, starting, stopping, pausing, resuming, muting audio/video, and seeking within the stream. These operations are crucial for real-time media consumption. ```cpp virtual int setupPlayStreamingCanvas(const char *stream_id, NERtcVideoCanvas *canvas) = 0; virtual int startPlayStreaming(const char *stream_id, NERtcPlayStreamingConfig *config) = 0; virtual int stopPlayStreaming(const char *stream_id) = 0; virtual int pausePlayStreaming(const char *stream_id) = 0; virtual int resumePlayStreaming(const char *stream_id) = 0; virtual int muteVideoForPlayStreaming(const char *stream_id, bool mute) = 0; virtual int muteAudioForPlayStreaming(const char *stream_id, bool mute) = 0; virtual int seekPlayStreaming(const char *stream_id, int64_t position_ms) = 0; ```