NERtc iOS SDK
V4.4.301
|
NERtcEngine extended API 更多...
#import <INERtcEngineEx.h>
构造函数 | |
(int) | - enableDualStreamMode: |
Enables or disables the dual-stream mode. 更多... | |
(int) | - setLocalMediaPriority:preemptive: |
Sets the priority of media streams from a local user. 更多... | |
(int) | - setLocalPublishFallbackOption: |
Sets the fallback option for the published local video stream based on the network conditions. 更多... | |
(int) | - setRemoteSubscribeFallbackOption: |
Sets the fallback option for the subscribed remote audio and video stream with poor network connections. 更多... | |
(int) | - muteLocalAudio: |
Stops or resumes publishing the local audio stream. 更多... | |
(int) | - subscribeRemoteAudio:forUserID: |
Subscribes to or unsubscribes from audio streams from specified remote users. 更多... | |
(int) | - subscribeAllRemoteAudio: |
Subscribes to or unsubscribes from audio streams from all remote users. 更多... | |
(int) | - subscribeRemoteVideo:forUserID:streamType: |
Subscribes to or unsubscribes from video streams from specified remote users. 更多... | |
(int) | - startPreview |
Enables video preview. 更多... | |
(int) | - stopPreview |
Stops video preview. 更多... | |
(int) | - setLocalRenderScaleMode: |
Sets the local video display mode. 更多... | |
(int) | - setRemoteRenderScaleMode:forUserID: |
Sets the remote video display mode. 更多... | |
(int) | - setVideoRotationMode: |
Sets the orientation mode for the local video. 更多... | |
(int) | - muteLocalVideo: |
Stops or resumes publishing the local video stream. 更多... | |
(int) | - setLoudspeakerMode: |
Enables or disables the audio playback route to the speakerphone. 更多... | |
(int) | - getLoudspeakerMode: |
Checks whether the speakerphone is enabled. 更多... | |
(int) | - startAudioDump |
Starts recording an audio dump file. 更多... | |
(int) | - stopAudioDump |
Stops recording an audio dump file. 更多... | |
(int) | - setExternalVideoSource:isScreen: |
Enables or disables the external video input source. 更多... | |
(int) | - pushExternalVideoFrame: |
Publishes the external video frames. 更多... | |
(int) | - setupLocalSubStreamVideoCanvas: |
Sets the local substream canvas. 更多... | |
(int) | - startScreenCapture: |
Enables screen sharing. 更多... | |
(int) | - stopScreenCapture |
Disables screen sharing with the substream transmission. 更多... | |
(int) | - setLocalRenderSubStreamScaleMode: |
Sets the display mode of the local substream video for screen sharing. 更多... | |
(int) | - setupRemoteSubStreamVideoCanvas:forUserID: |
Sets a remote substream canvas. 更多... | |
(int) | - subscribeRemoteSubStreamVideo:forUserID: |
Subscribes to or unsubscribes from remote video substream for screen sharing. 更多... | |
(int) | - setRemoteRenderSubStreamVideoScaleMode:forUserID: |
Sets the display mode of to remote substream video for screen sharing. 更多... | |
(int) | - setAudioSessionOperationRestriction: |
Sets permissions of the SDK over Audio Session. 更多... | |
(int) | - setPlayoutDeviceMute: |
Mutes or unmutes the audio playback device. 更多... | |
(int) | - getPlayoutDeviceMute: |
Gets the mute status of the audio playback device. 更多... | |
(int) | - setRecordDeviceMute: |
Mutes or unmutes the audio capture device. 更多... | |
(int) | - getRecordDeviceMute: |
Checks whether the audio capture device is muted. 更多... | |
(BOOL) | - isCameraZoomSupported |
Checks whether the camera zooming feature is supported. 更多... | |
(BOOL) | - isCameraTorchSupported |
Checks whether the camera flash feature is supported. 更多... | |
(BOOL) | - isCameraFocusSupported |
Checks whether the camera manual focus feature is supported. 更多... | |
(BOOL) | - isCameraExposurePositionSupported |
Checks whether the camera exposure feature is supported. 更多... | |
(int) | - setCameraExposurePosition: |
Sets the camera exposure position. 更多... | |
(int) | - setCameraTorchOn: |
Enables or disables the camera flash feature. 更多... | |
(BOOL) | - isCameraTorchOn |
Check whether the flash is turned on on the device. 更多... | |
(int) | - setCameraZoomFactor: |
Sets the current camera zoom ratio. 更多... | |
(float) | - maxCameraZoomScale |
Gets maximum zoom ratio supported by the camera. 更多... | |
(int) | - setCameraFocusPositionX:Y: |
Sets the camera manual focus position. 更多... | |
(int) | - startAudioMixingWithOption: |
Starts to play or mix the music file. 更多... | |
(int) | - stopAudioMixing |
Stops playing or mixing the music file. 更多... | |
(int) | - pauseAudioMixing |
Pauses playing and mixing the music file. 更多... | |
(int) | - resumeAudioMixing |
The method resumes mixing audio playback and continues playing the mixing audio. 更多... | |
(int) | - setAudioMixingSendVolume: |
Sets the publishing volume of the mixing audio. 更多... | |
(int) | - getAudioMixingSendVolume: |
Gets the volume for publishing mixing audio. 更多... | |
(int) | - setAudioMixingPlaybackVolume: |
Adjusts the volume of mixing audio for local playback. 更多... | |
(int) | - getAudioMixingPlaybackVolume: |
Gets the playback volume of the mixing audio. 更多... | |
(int) | - getAudioMixingDuration: |
Gets the duration of the mixing audio file. 更多... | |
(int) | - getAudioMixingCurrentPosition: |
Gets the playback position of the mixing audio file. 更多... | |
(int) | - setAudioMixingPosition: |
Sets the playback position of the mixing audio file to a different starting position. 更多... | |
(int) | - playEffectWitdId:effectOption: |
Plays back a specified sound effect file. 更多... | |
(int) | - stopEffectWitdId: |
Stops playing all sound effect files. 更多... | |
(int) | - stopAllEffects |
Stops playing all sound effect files. 更多... | |
(int) | - pauseEffectWitdId: |
Pauses playing a specified sound effect file. 更多... | |
(int) | - resumeEffectWitdId: |
Resumes playing a specified sound effect file. 更多... | |
(int) | - pauseAllEffects |
Pauses playing all sound effect files. 更多... | |
(int) | - resumeAllEffects |
Resumes playing all sound effect files. 更多... | |
(int) | - setEffectSendVolumeWithId:volume: |
Sets the publishing volume of a sound effect file. 更多... | |
(int) | - getEffectSendVolumeWithId:volume: |
Gets the publishing volume of a specified sound effect file. 更多... | |
(int) | - setEffectPlaybackVolumeWithId:volume: |
Sets the playback volume of the sound effect files. 更多... | |
(int) | - getEffectPlaybackVolumeWithId:volume: |
Gets the playback volume of the sound effect files 更多... | |
(int) | - getEffectDurationWithId:duration: |
Gets the duration of a sound effect file. 更多... | |
(int) | - getEffectCurrentPositionWithId:position: |
Gets the playback position of a sound effect file. 更多... | |
(int) | - enableEarback:volume: |
Enables the in-ear monitoring feature. 更多... | |
(int) | - setEarbackVolume: |
Sets the volume for in-ear monitoring. 更多... | |
(int) | - startAudioRecording:sampleRate:quality: |
Starts an audio recording from a client. 更多... | |
(int) | - stopAudioRecording |
Stops the audio recording on the client. 更多... | |
(int) | - setExternalAudioSource:sampleRate:channels: |
Sets the external audio input source. 更多... | |
(int) | - pushExternalAudioFrame: |
Publishes the external audio frame. 更多... | |
(int) | - setExternalAudioRender:sampleRate:channels: |
Sets external audio rendering. 更多... | |
(int) | - pullExternalAudioFrame:length: |
Pulls the external audio data. 更多... | |
(int) | - addEngineMediaStatsObserver: |
Registers a stats observer. 更多... | |
(int) | - removeEngineMediaStatsObserver: |
Removes the specified media stats observer. 更多... | |
(int) | - cleanupEngineMediaStatsObserver |
Clears all media stats observers. 更多... | |
(int) | - addLiveStreamTask:compeltion: |
Adds a streaming task in a room. 更多... | |
(int) | - updateLiveStreamTask:compeltion: |
Updates a streaming task. 更多... | |
(int) | - removeLiveStreamTask:compeltion: |
Deletes a streaming task. 更多... | |
(int) | - setRecordingAudioFrameParameters: |
Sets the format of audio capture. 更多... | |
(int) | - setPlaybackAudioFrameParameters: |
Sets the audio playback format. 更多... | |
(int) | - setMixedAudioFrameParameters: |
Sets the format of the recording and mixing audio. 更多... | |
(int) | - setAudioFrameObserver: |
Registers the audio observer. 更多... | |
(int) | - enableAudioVolumeIndication:interval: |
Enables reporting users' volume indication. 更多... | |
(int) | - adjustRecordingSignalVolume: |
Adjusts the volume of captured signals. 更多... | |
(int) | - adjustPlaybackSignalVolume: |
Adjusts the playback signal volume of all remote users. 更多... | |
(int) | - adjustUserPlaybackSignalVolume:forUserID: |
Adjust the volume of local signal playback from a specified remote user. 更多... | |
(int) | - setLocalVoicePitch: |
Sets the voice pitch of the local audio. 更多... | |
(int) | - setLocalVoiceEqualizationOfBandFrequency:withGain: |
Sets the local voice equalization effect, or customizes center frequencies of the local voice effects. 更多... | |
(int) | - setVoiceBeautifierPreset: |
Sets an SDK preset voice beautifier effect. 更多... | |
(int) | - setAudioEffectPreset: |
Sets an SDK preset voice changer effect. 更多... | |
(int) | - setLocalCanvasWatermarkConfigs:withStreamType: |
Adds a watermark image to the local video. 更多... | |
(int) | - setRemoteCanvasWatermarkConfigs:forUserID:withStreamType: |
Adds a watermark to the remote video canvas. 更多... | |
(int) | - takeLocalSnapshot:callback: |
Takes a local video snapshot. 更多... | |
(int) | - takeRemoteSnapshot:forUserID:callback: |
Takes a snapshot of a remote video. 更多... | |
(int) | - uploadSdkInfo |
Uploads the SDK information. 更多... | |
(int) | - sendSEIMsg:streamChannelType: |
Sends supplemental enhancement information (SEI) data through a specified bigstream or substream. 更多... | |
(int) | - sendSEIMsg: |
Sends SEI data through the bigstream. 更多... | |
(int) | - startChannelMediaRelay: |
Starts to relay media streams across rooms. 更多... | |
(int) | - updateChannelMediaRelay: |
Updates the information of the destination room for media stream relay. 更多... | |
(int) | - stopChannelMediaRelay |
Stops media stream relay across rooms. 更多... | |
(int) | - enableSuperResolution: |
Enables or disables AI super resolution. 更多... | |
(int) | - enableEncryption:config: |
Turns on or off media stream encryption. 更多... | |
(int) | - setCloudProxy: |
开启并设置云代理服务。 在内网环境下,如果用户防火墙开启了网络限制,请参考《使用云代理》将指定 IP 地址和端口号加入防火墙白名单,然后调用此方法开启云代理,并将 proxyType 参数设置为 NERtcTransportTypeUDPProxy(1),即指定使用 UDP 协议的云代理。 更多... | |
![]() | |
(NERtcConnectionStateType) | - connectionState |
Gets the connection status. 更多... | |
(int) | - setupEngineWithContext: |
Creates an NERtcEngine instance and initializes the NERTC SDK. 更多... | |
(int) | - joinChannelWithToken:channelName:myUid:completion: |
Joins an RTC room. 更多... | |
(int) | - leaveChannel |
Leaves a room, such as hanging up or ending a call. 更多... | |
(int) | - switchChannelWithToken:channelName:completion: |
Switches to a different RTC room. 更多... | |
(int) | - enableLocalAudio: |
Enables or disables local audio capture. 更多... | |
(int) | - enableLocalVideo: |
Specifies whether to enable local video capture. 更多... | |
(int) | - setChannelProfile: |
Sets a room scene. 更多... | |
(int) | - setLocalVideoConfig: |
Sets the video encoding profile. 更多... | |
(int) | - setAudioProfile:scenario: |
Sets the audio encoding profile. 更多... | |
(int) | - setupLocalVideoCanvas: |
Sets the local view. 更多... | |
(int) | - setupRemoteVideoCanvas:forUserID: |
Sets views for remote users. 更多... | |
(int) | - switchCamera |
Switches between the front and rear cameras. 更多... | |
(int) | - setClientRole: |
Sets the role of a user in live streaming. 更多... | |
(int) | - setParameters: |
Sets parameters for audio and video calls. 更多... | |
NERtcEngine extended API
- (int) addEngineMediaStatsObserver: | (id< NERtcEngineMediaStatsObserver >) | observer |
Registers a stats observer.
observer | The stats observer. For more information, see NERtcEngineMediaStatsObserver. |
- (int) addLiveStreamTask: | (NERtcLiveStreamTaskInfo *) | taskInfo | |
compeltion: | (NERtcLiveStreamCompletion) | completion | |
Adds a streaming task in a room.
After you call the method, the current user can receive a notification about the status of live streaming.
taskInfo | The information about the streaming task. For more information, NERtcLiveStreamTaskInfo. |
completion | The result. The callback is triggered after the method is called. For more information, see NERtcLiveStreamCompletion. |
- (int) adjustPlaybackSignalVolume: | (uint32_t) | volume |
Adjusts the playback signal volume of all remote users.
volume | The playback signal volume. Valid range: 0 to 400. Where: |
- (int) adjustRecordingSignalVolume: | (uint32_t) | volume |
Adjusts the volume of captured signals.
volume | The volume of captured signals. Valid values: 0 to 400. Where: |
- (int) adjustUserPlaybackSignalVolume: | (uint32_t) | volume | |
forUserID: | (uint64_t) | userID | |
Adjust the volume of local signal playback from a specified remote user.
After you join the room, you can call the method to set the volume of local audio playback from different remote users or repeatedly adjust the volume of audio playback from a specified remote user.
userID | The ID of a remote user. |
volume | The playback volume. Valid values: 0 to 100.
|
- (int) cleanupEngineMediaStatsObserver |
Clears all media stats observers.
- (int) enableAudioVolumeIndication: | (BOOL) | enable | |
interval: | (uint64_t) | interval | |
Enables reporting users' volume indication.
The method allows the SDK to report to the app the information about the volume of the user that publishes local streams and the remote users (up to three users) that have the highest instantaneous volume. The information about the current speaker and the volume is reported.
If this method is enabled. When a user joins a room and pushes streams, the SDK triggers the onRemoteAudioVolumeIndication callback based on the preset time intervals.
enable | The option whether to prompt the speaker volume. |
interval | The time interval at which the volume prompt is displayed. Unit: milliseconds. The value must be multiples of 100 milliseconds. We recommend that you set the value 200 milliseconds or more. |
- (int) enableDualStreamMode: | (BOOL) | enable |
Enables or disables the dual-stream mode.
The method sets the individual-stream mode or dual-stream mode. If the dual-stream mode is enabled on the publishing client, the receiver can choose to receive the high-quality stream or low-quality stream video. The high-quality stream has a high resolution and high bitrate. The low-quality stream has a low resolution and low bitrate.
enable | A value of YES indicates that the dual-stream mode is enabled. A value of NO indicates that the dual stream mode is disabled. |
- (int) enableEarback: | (BOOL) | enabled | |
volume: | (uint32_t) | volume | |
Enables the in-ear monitoring feature.
enabled | The option whether to enable in-ear monitoring. |
volume | The volume for in-ear monitoring. Valid values: 0 to 100. The default value is 100. |
- (int) enableEncryption: | (BOOL) | enable | |
config: | (NERtcEncryptionConfig *) | config | |
Turns on or off media stream encryption.
In scenarios with high security requirements such as finance, you can use this method to set the media stream encryption mode before you join the room.
enable | The option whether to enable media stream encryption.
|
config | The configuration for media stream relay. For more information, see NERtcEncryptionConfig. |
- (int) enableSuperResolution: | (BOOL) | enabled |
Enables or disables AI super resolution.
enabled | The option whether to enable AI super resolution. By default, the setting is disabled. |
- (int) getAudioMixingCurrentPosition: | (uint64_t *) | position |
Gets the playback position of the mixing audio file.
The method gets the playback position of the audio file. Unit: milliseconds. You can call the method when you are in a room.
position | The playback position of the mixing audio file. Unit: milliseconds. |
- (int) getAudioMixingDuration: | (uint64_t *) | duration |
Gets the duration of the mixing audio file.
The method gets the duration of the mixing audio file. Unit: milliseconds. You can call the method when you are in a room.
duration | The duration of the mixing audio file. Unit: milliseconds. |
- (int) getAudioMixingPlaybackVolume: | (uint32_t *) | volume |
Gets the playback volume of the mixing audio.
The method gets the playback volume of mixing audio. You can call the method when you are in a room.
volume | The playback volume of the mixing audio. Valid values: 0 to 100. |
- (int) getAudioMixingSendVolume: | (uint32_t *) | volume |
Gets the volume for publishing mixing audio.
The method gets the volume of mixing audio. You can call the method when you are in a room.
volume | The volume of publishing audio mixing. |
- (int) getEffectCurrentPositionWithId: | (uint32_t) | effectId | |
position: | (uint64_t *) | position | |
Gets the playback position of a sound effect file.
The method gets the playback position of the audio file. Unit: milliseconds.
[in] | effectId | The ID of a sound effect file. |
[out] | position | The playback position of the sound effect file. Unit: milliseconds. |
- (int) getEffectDurationWithId: | (uint32_t) | effectId | |
duration: | (uint64_t *) | duration | |
Gets the duration of a sound effect file.
The method gets the duration of the sound effect file. Unit: milliseconds.
[in] | effectId | The ID of a sound effect file. |
[out] | duration | The duration of the sound effect file. Unit: milliseconds. |
- (int) getEffectPlaybackVolumeWithId: | (uint32_t) | effectId | |
volume: | (uint32_t *) | volume | |
Gets the playback volume of the sound effect files
effectId | The ID of a sound effect file. |
volume | The returned volume of the sound effect file. |
- (int) getEffectSendVolumeWithId: | (uint32_t) | effectId | |
volume: | (uint32_t *) | volume | |
Gets the publishing volume of a specified sound effect file.
You can call this method after you join a room.
effectId | The ID of the specified sound effect file. Each sound effect file has a unique ID. |
volume | The returned publishing volume of the sound effect file. |
- (int) getLoudspeakerMode: | (bool *) | enabled |
Checks whether the speakerphone is enabled.
enabled | The option whether to enable the speakerphone mode. |
- (int) getPlayoutDeviceMute: | (bool *) | muted |
Gets the mute status of the audio playback device.
muted | The option whether the device is muted. |
- (int) getRecordDeviceMute: | (bool *) | muted |
Checks whether the audio capture device is muted.
muted | The option whether the device is muted. |
- (BOOL) isCameraExposurePositionSupported |
Checks whether the camera exposure feature is supported.
- (BOOL) isCameraFocusSupported |
Checks whether the camera manual focus feature is supported.
- (BOOL) isCameraTorchOn |
Check whether the flash is turned on on the device.
- (BOOL) isCameraTorchSupported |
Checks whether the camera flash feature is supported.
- (BOOL) isCameraZoomSupported |
Checks whether the camera zooming feature is supported.
Make sure that you call this method after the camera starts. For example, you can call this method after you call startPreview or joinChannel.
- (float) maxCameraZoomScale |
Gets maximum zoom ratio supported by the camera.
- (int) muteLocalAudio: | (BOOL) | muted |
Stops or resumes publishing the local audio stream.
The method is used to stop or resume publishing the local audio stream.
muted | The option whether to enable publishing the local audio stream. |
- (int) muteLocalVideo: | (BOOL) | muted |
Stops or resumes publishing the local video stream.
If you call the method successfully, the remote client triggers the onNERtcEngineUser:videoMuted: callback.
muted | The option whether to stop publishing the local video stream. |
- (int) pauseAllEffects |
Pauses playing all sound effect files.
You can call this method after you join a room.
- (int) pauseAudioMixing |
Pauses playing and mixing the music file.
The method pauses playing mixing audio. You can call the method when you are in a room.
- (int) pauseEffectWitdId: | (uint32_t) | effectId |
Pauses playing a specified sound effect file.
You can call this method after you join a room.
effectId | The ID of a sound effect file. |
- (int) playEffectWitdId: | (uint32_t) | effectId | |
effectOption: | (NERtcCreateAudioEffectOption *) | option | |
Plays back a specified sound effect file.
The method plays a specified local or online sound effect file.
effectId | The ID of the specified sound effect. Each sound effect has a unique ID. |
option | The parameters, such as the type of mixing audio tasks, and the path of the mixing audio file. For more information, see NERtcCreateAudioEffectOption. |
- (int) pullExternalAudioFrame: | (void *_Nonnull) | data | |
length: | (int) | len | |
Pulls the external audio data.
The method pulls the audio data from the internal audio engine. After you enable the external audio data rendering functionality by calling setExternalAudioRender, you can use pullExternalAudioFrame to get the audio PCM data.
data | The data pointer. |
len | The size of the audio data that are pulled. Unit: bytes. We recommend that the duration of the audio data at least last 10 ms, and the data size cannot exceed 7680 bytes. Formula: len = sampleRate/1000 × 2 × channels × duration of the audio data in milliseconds |
- (int) pushExternalAudioFrame: | (NERtcAudioFrame *) | frame |
Publishes the external audio frame.
The method pushes the external audio frame data to the internal audio engine. If you enable the external audio data source by calling setExternalAudioSource, you can use pushExternalAudioFrame to send audio PCM data.
frame | The external audio frame data. The data cannot exceed 7,680 bytes. |
- (int) pushExternalVideoFrame: | (NERtcVideoFrame *) | frame |
Publishes the external video frames.
The method actively publishes the data of video frames that are encapsulated with the NERtcVideoFrame class to the SDK.
frame | The information about video frame data. For more information, see NERtcVideoFrame. |
- (int) removeEngineMediaStatsObserver: | (id< NERtcEngineMediaStatsObserver >) | observer |
Removes the specified media stats observer.
observer | The stats observer |
- (int) removeLiveStreamTask: | (NSString *) | taskId | |
compeltion: | (NERtcLiveStreamCompletion) | completion | |
Deletes a streaming task.
taskId | The ID of a streaming task. |
completion | The result. The callback is triggered after the method is called. For more information, see NERtcLiveStreamCompletion. |
- (int) resumeAllEffects |
Resumes playing all sound effect files.
You can call this method after you join a room.
- (int) resumeAudioMixing |
The method resumes mixing audio playback and continues playing the mixing audio.
You can call the method when you are in a room.
- (int) resumeEffectWitdId: | (uint32_t) | effectId |
Resumes playing a specified sound effect file.
You can call this method after you join a room.
effectId | The ID of the specified sound effect. Each sound effect has a unique ID. |
- (int) sendSEIMsg: | (NSData *) | data |
Sends SEI data through the bigstream.
When you publish the local audio and video stream, SEI data is also sent to sync some additional information. After SEI data is sent, the receiver can retrieve the content by listening for the onRecvSEIMsg callback.
data | The custom SEI data. |
- (int) sendSEIMsg: | (NSData *) | data | |
streamChannelType: | (NERtcStreamChannelType) | type | |
Sends supplemental enhancement information (SEI) data through a specified bigstream or substream.
When you publish the local audio and video stream, SEI data is also sent to sync some additional information. After SEI data is sent, the receiver can retrieve the content by listening for the onRecvSEIMsg callback.
data | The custom SEI data. |
type | The type of the channel with which the SEI data is transmitted. For more information, see NERtcStreamChannelType. |
- (int) setAudioEffectPreset: | (NERtcVoiceChangerType) | type |
Sets an SDK preset voice changer effect.
The method can apply multiple preset voice changer effects to original human voices and change audio profiles.
type | The type of the preset voice changer effect. By default, the sound effect is disabled. For more information, see NERtcVoiceChangerType. |
- (int) setAudioFrameObserver: | (nullable id< NERtcEngineAudioFrameObserver >) | observer |
Registers the audio observer.
The method can set audio capture or play PCM data callbacks. The method can process audio streams. The method can register the callback that is triggered by the audio engine, such as onPlaybackFrame.
observer | The audio frame observer. If you pass in NULL, you cancel the registration and clear the settings of NERtcAudioFrameRequestFormat. For more information, see NERtcEngineAudioFrameObserver. |
- (int) setAudioMixingPlaybackVolume: | (uint32_t) | volume |
Adjusts the volume of mixing audio for local playback.
The method adjusts the volume of mixing audio for local playback. You can call the method when you are in a room.
volume | The playback volume of the mixing audio. Valid values: 0 to 100. The default value of 100 indicates the original volume. |
- (int) setAudioMixingPosition: | (uint64_t) | position |
Sets the playback position of the mixing audio file to a different starting position.
The method sets the playback position of the mixing audio file to a different starting position. The method allows you to play the mixing audio file from the position based on your requirements rather than from the beginning.
position | The playback position of the mixing audio file. Unit: milliseconds. |
- (int) setAudioMixingSendVolume: | (uint32_t) | volume |
Sets the publishing volume of the mixing audio.
volume | The volume of publishing mixing audio. Valid values: 0 to 100. The default value of 100 indicates the original volume. |
- (int) setAudioSessionOperationRestriction: | (NERtcAudioSessionOperationRestriction) | restriction |
Sets permissions of the SDK over Audio Session.
This method is only applicable to the iOS platform. This method controls the permissions of the SDK over Audio Session. By default, the SDK and the app have control over the Audio Session. However, in some cases, the app wants to restrict the SDK's permissions over Audio Session and uses other applications or third-party components to control Audio Session. The app can adjust the permissions of the SDK by calling this method. You can call this method only before you join the room.
restriction | The restriction applied to the SDK for Audio Session. For more information, see NERtcAudioSessionOperationRestriction. |
- (int) setCameraExposurePosition: | (CGPoint) | positionInView |
Sets the camera exposure position.
After you call the method, the onCameraExposureChanged callback is triggered on the local client.
positionInView | The exposure position point. |
- (int) setCameraFocusPositionX: | (float) | focusX | |
Y: | (float) | focusY | |
Sets the camera manual focus position.
After you call the method, the onNERtcCameraFocusChanged callback is triggered on the local client.
x | The horizontal coordinate of the touch point in the view. Value range: 0 to 1. |
y | The vertical coordinate of the touch point in the view. Value range: 0 to 1. |
- (int) setCameraTorchOn: | (BOOL) | on |
Enables or disables the camera flash feature.
on | YES: turn on. NO: turn off. |
- (int) setCameraZoomFactor: | (float) | factor |
Sets the current camera zoom ratio.
factor | The zoom ratio supported by the camera. |
- (int) setCloudProxy: | (NERtcTransportType) | proxyType |
开启并设置云代理服务。
在内网环境下,如果用户防火墙开启了网络限制,请参考《使用云代理》将指定 IP 地址和端口号加入防火墙白名单,然后调用此方法开启云代理,并将 proxyType 参数设置为 NERtcTransportTypeUDPProxy(1),即指定使用 UDP 协议的云代理。
onNERtcEngineConnectionStateChangeWithState(kNERtcConnectionStateConnecting, kNERtcReasonConnectionChangedSettingProxyServer)
回调。setCloudProxy(NERtcTransportTypeNoneProxy)
。 proxyType | 云代理类型。详细信息请参考 NERtcTransportType。该参数为必填参数,若未赋值,SDK 会报错。 |
- (int) setEarbackVolume: | (uint32_t) | volume |
Sets the volume for in-ear monitoring.
volume | The volume for in-ear monitoring. Valid values: 0 to 100. The default value is 100. |
- (int) setEffectPlaybackVolumeWithId: | (uint32_t) | effectId | |
volume: | (uint32_t) | volume | |
Sets the playback volume of the sound effect files.
You can call this method after you join a room.
effectId | The ID of the specified audio effect file. Each sound effect file has a unique ID. |
volume | The playback volume of the sound effect file. Valid values: 0 to 100. The default value is 100. |
- (int) setEffectSendVolumeWithId: | (uint32_t) | effectId | |
volume: | (uint32_t) | volume | |
Sets the publishing volume of a sound effect file.
You can call this method after you join a room.
effectId | The ID of the specified sound effect. Each sound effect has a unique ID. |
volume | The publishing volume of the sound effect file. Valid values: 0 to 100. The default value of 100 indicates the original volume. |
- (int) setExternalAudioRender: | (BOOL) | enabled | |
sampleRate: | (int32_t) | sampleRate | |
channels: | (int32_t) | channels | |
Sets external audio rendering.
The method is suitable for scenarios that require personalized audio rendering. By default, the setting is disabled. If you choose an audio playback device or a sudden restart occurs, the setting becomes invalid.
After you call the method, you can use pullExternalAudioFrame to get audio PCM data.
enabled | The option whether to enable external audio rendering. |
sampleRate | The sample rate of the external audio rendering. Unit: Hz. Valid values: 16000, 32000, 44100, and 48000. |
channels | The number of channels for external audio rendering. Valid values: |
- (int) setExternalAudioSource: | (BOOL) | enabled | |
sampleRate: | (int32_t) | sampleRate | |
channels: | (int32_t) | channels | |
Sets the external audio input source.
After you call the method, the setting becomes invalid if you choose an audio input device or a sudden restart occurs. After the method is called, you can call pushExternalAudioFrame to send the pulse-code modulation (PCM) data.
enabled | The option whether to enable external data input. The default value is NO. |
sampleRate | The sample rate of the external audio source. Unit: Hz. Recommended values: 8000, 16000, 32000, 44100, and 48000. |
channels | The number of sound channels. Valid values: |
- (int) setExternalVideoSource: | (BOOL) | enable | |
isScreen: | (BOOL) | isScreen | |
Enables or disables the external video input source.
enable | The option whether to use the external video source. |
isScreen | The option whether the external video source is used for screen sharing. |
- (int) setLocalCanvasWatermarkConfigs: | (nullable NERtcCanvasWatermarkConfig *) | config | |
withStreamType: | (NERtcStreamChannelType) | type | |
Adds a watermark image to the local video.
type | The type of video streams. You can set the value to bigstream or substream. For more information, see NERtcStreamChannelType. |
config | The configuration of the watermark for the canvas. You can set text watermark, image watermark, and timestamp watermark. A value of null indicates removing the watermark. For more information, see NERtcCanvasWatermarkConfig. |
- (int) setLocalMediaPriority: | (NERtcMediaPriorityType) | priority | |
preemptive: | (BOOL) | preemptive | |
Sets the priority of media streams from a local user.
If a user has a high priority, the media stream from the user also has a high priority. In unreliable network connections, the SDK guarantees the quality of the media stream from users with a high priority.
priority | The priority of the local media stream. The default value is kNERtcMediaPriorityNormal, which indicates the normal priority. For more information, see NERtcMediaPriorityType. |
isPreemptive | The option whether to enable the preempt mode.
|
- (int) setLocalPublishFallbackOption: | (NERtcStreamFallbackOptions) | option |
Sets the fallback option for the published local video stream based on the network conditions.
The quality of the published local audio and video streams is degraded with poor quality network connections. After you call this method and set the option to kNERtcStreamFallbackOptionAudioOnly:
If the published audio and video stream from the local client falls back to the audio stream, or recovers to the audio and video stream, the SDK triggers the onLocalPublishFallbackToAudioOnly callback.
option | The fallback options for publishing audio and video streams. The default value is disabled. For more information, see NERtcStreamFallbackOptions. |
- (int) setLocalRenderScaleMode: | (NERtcVideoRenderScaleMode) | mode |
Sets the local video display mode.
mode | The video display mode. For more information, see NERtcVideoRenderScaleMode. |
- (int) setLocalRenderSubStreamScaleMode: | (NERtcVideoRenderScaleMode) | mode |
Sets the display mode of the local substream video for screen sharing.
Use this method if you want to enable screen sharing through the local substream. Apps can call this method multiple times to change the display mode.
mode | The video display mode. For more information, see NERtcVideoRenderScaleMode. |
- (int) setLocalVoiceEqualizationOfBandFrequency: | (NERtcAudioEqualizationBandFrequency) | bandFrequency | |
withGain: | (NSInteger) | gain | |
Sets the local voice equalization effect, or customizes center frequencies of the local voice effects.
bandFrequency | The band frequency. Value range: 0 to 9. The values represent the respective 10-band center frequencies of the voice effects, including 31, 62, 125, 250, 500, 1k, 2k, 4k, 8k, and 16k Hz. |
bandGain | The gain of each band (dB). Value range: -15 to 15. The default value is 0. |
- (int) setLocalVoicePitch: | (double) | pitch |
Sets the voice pitch of the local audio.
The method changes the voice pitch of the local speaker.
pitch | The voice frequency. Valid values: 0.5 to 2.0. Smaller values have lower pitches. The default value is 1, which indicates that the pitch is not changed. |
- (int) setLoudspeakerMode: | (bool) | enable |
Enables or disables the audio playback route to the speakerphone.
The method is used to specify whether to route audio playback to the speakerphone.
enable | The option whether to route the audio playback to the external loudspeaker. |
- (int) setMixedAudioFrameParameters: | (nullable NERtcAudioFrameRequestFormat *) | format |
Sets the format of the recording and mixing audio.
The method sets the format of the audio frames returned by onNERtcEngineMixedAudioFrame.
format | The sample rate and the number of channels returned by onNERtcEngineMixedAudioFrame. A value of nil is allowed. The default value is nil, which indicates that the original format of the audio file is used. For more information, see NERtcAudioFrameRequestFormat. |
- (int) setPlaybackAudioFrameParameters: | (nullable NERtcAudioFrameRequestFormat *) | format |
Sets the audio playback format.
The method sets the playback format of the audio data returned by onNERtcEngineAudioFrameWillPlayback.
format | The sample rate and the number of channels returned by onNERtcEngineAudioFrameDidRecord. A value of nil is allowed. The default value is nil, which indicates that the original format of the audio file is used. For more information, see NERtcAudioFrameRequestFormat. |
- (int) setPlayoutDeviceMute: | (bool) | muted |
Mutes or unmutes the audio playback device.
muted | The option whether to mute the playback device. By default, the setting is unmuted. |
- (int) setRecordDeviceMute: | (bool) | muted |
Mutes or unmutes the audio capture device.
muted | The option whether to mute the audio capture device. The default setting is unmuted. |
- (int) setRecordingAudioFrameParameters: | (nullable NERtcAudioFrameRequestFormat *) | format |
Sets the format of audio capture.
The method sets the format of the recording for onNERtcEngineAudioFrameDidRecord.
format | The sample rate and the number of channels returned by onNERtcEngineAudioFrameDidRecord. A value of nil is allowed. The default value is nil, which indicates that the original format of the audio file is used. For more information, see NERtcAudioFrameRequestFormat. |
- (int) setRemoteCanvasWatermarkConfigs: | (nullable NERtcCanvasWatermarkConfig *) | config | |
forUserID: | (uint64_t) | userID | |
withStreamType: | (NERtcStreamChannelType) | type | |
Adds a watermark to the remote video canvas.
userID | The ID of a remote user. |
type | The type of video streams. You can set the value to bigstream or substream. For more information, see NERtcStreamChannelType. |
config | The configuration of the watermark for the canvas. You can set text watermark, image watermark, and timestamp watermark. A value of null indicates to remove the watermark. For more information, see NERtcCanvasWatermarkConfig. |
- (int) setRemoteRenderScaleMode: | (NERtcVideoRenderScaleMode) | mode | |
forUserID: | (uint64_t) | userID | |
Sets the remote video display mode.
mode | The video display mode. For more information, see NERtcVideoRenderScaleMode. |
userID | The ID of a remote user. |
- (int) setRemoteRenderSubStreamVideoScaleMode: | (NERtcVideoRenderScaleMode) | mode | |
forUserID: | (uint64_t) | userID | |
Sets the display mode of to remote substream video for screen sharing.
mode | The video display mode. For more information, see NERtcVideoRenderScaleMode. |
userID | The ID of a remote user. |
- (int) setRemoteSubscribeFallbackOption: | (NERtcStreamFallbackOptions) | option |
Sets the fallback option for the subscribed remote audio and video stream with poor network connections.
The quality of the subscribed audio and video streams is degraded with unreliable network connections. After you set the fallback options for the subscribed audio and video stream by using this method:
option | The fallback option for subscribing to audio and video streams. The default setting is to fall back to the low-quality video stream in the poor network. For more information, see NERtcStreamFallbackOptions. |
- (int) setupLocalSubStreamVideoCanvas: | (NERtcVideoCanvas *) | canvas |
Sets the local substream canvas.
This method is used to set the display information about the local screen sharing with the substream video. The app associates with the video view of local substream by calling this method. During application development, in most cases, before joining a room, you must first call this method to set the local video view after the SDK is initialized.
canvas | The video canvas. For more information, see NERtcVideoCanvas. To delete the canvas setting, set the value to nil. |
- (int) setupRemoteSubStreamVideoCanvas: | (NERtcVideoCanvas *) | canvas | |
forUserID: | (uint64_t) | userID | |
Sets a remote substream canvas.
The method associates a remote user with a substream view. You can assign a specified userID to use a corresponding canvas.
userID | The ID of a remote user. |
canvas | The video canvas. For more information, see NERtcVideoCanvas. To delete the canvas setting, set the value to nil. |
- (int) setVideoRotationMode: | (NERtcVideoRotationMode) | rotationMode |
Sets the orientation mode for the local video.
This API is used to set the orientation mode of the local video screen on the local and remote devices. You can specify that the local screen adapts to the landscape or portrait mode of the system device, or the landscape or portrait mode of the app UI.
rotationMode | The video orientation mode. For more information, see NERtcVideoRotationMode. |
- (int) setVoiceBeautifierPreset: | (NERtcVoiceBeautifierType) | type |
Sets an SDK preset voice beautifier effect.
The method can set an SDK preset voice beautifier effect for a local user who publishes an audio stream.
type | The type of the preset voice beautifier effect. By default, the voice beautifier effect is disabled. For more information, see NERtcVoiceBeautifierType. |
- (int) startAudioDump |
Starts recording an audio dump file.
Audio dump files can be used to analyze audio issues.
- (int) startAudioMixingWithOption: | (NERtcCreateAudioMixingOption *) | option |
Starts to play or mix the music file.
This method mixes the specified local or online audio file with the audio stream captured from the recording device.
option | The options when you configure a mixing audio task, such as the type of audio mixing tasks, the full path of the mixing audio file, or URL. For more information, see NERtcCreateAudioMixingOption. |
- (int) startAudioRecording: | (NSString *) | filePath | |
sampleRate: | (int) | sampleRate | |
quality: | (NERtcAudioRecordingQuality) | quality | |
Starts an audio recording from a client.
The method records the mixing audio from all room members in the room, and store the recording file locally. The onAudioRecording() callback is triggered when the recording starts or ends.
If you specify a type of audio quality, the recording file is saved in different formats.
filePath | The file path where the recording file is stored. The file name and format are required. For example, sdcard/xxx/audio.aac.
|
sampleRate | The recording sample rate. Valid values: 16000,32000, 44100, and 48000. The default value is 32000. |
quality | The audio quality. The parameter is valid only the recording file is in AAC format. For more information, see NERtcAudioRecordingQuality. |
- (int) startChannelMediaRelay: | (NERtcChannelMediaRelayConfiguration *_Nonnull) | config |
Starts to relay media streams across rooms.
config | The configuration for media stream relay across rooms. For more information, see NERtcChannelMediaRelayConfiguration. |
- (int) startPreview |
Enables video preview.
- (int) startScreenCapture: | (NERtcVideoSubStreamEncodeConfiguration *) | config |
Enables screen sharing.
The content of the screen sharing is published through the substream.
You can call the method only after you join a room.
If you join a room and call this method to enable the substream, the onUserSubStreamVideoStart callback is triggered on the remote client.
config | The encoding configuration of the local substream. For more information, see NERtcVideoSubStreamEncodeConfiguration. |
- (int) stopAllEffects |
Stops playing all sound effect files.
You can call this method after you join a room.
- (int) stopAudioDump |
Stops recording an audio dump file.
- (int) stopAudioMixing |
Stops playing or mixing the music file.
The method stops playing mixing audio. You can call the method when you are in a room.
- (int) stopAudioRecording |
Stops the audio recording on the client.
If the local client leaves the room, audio recording automatically stops. You can call the stopAudioRecording method to manually stop recording during calls.
- (int) stopChannelMediaRelay |
Stops media stream relay across rooms.
If the host leave the room, media stream replay across rooms automatically stops. You can also call stopChannelMediaRelay. In this case, the host leaves all destination rooms. If you call this method, the SDK triggers the onNERtcEngineChannelMediaRelayStateDidChange callback. If NERtcChannelMediaRelayStateRunning is returned, the media stream relay stops.
- (int) stopEffectWitdId: | (uint32_t) | effectId |
Stops playing all sound effect files.
You can call this method after you join a room.
effectId | The ID of the specified sound effect. Each sound effect has a unique ID. |
- (int) stopPreview |
Stops video preview.
- (int) stopScreenCapture |
Disables screen sharing with the substream transmission.
If you use the method to disable the substream after you join a room, the onNERtcEngineUserSubStreamDidStop callback is triggered on the remote client.
- (int) subscribeAllRemoteAudio: | (BOOL) | subscribe |
Subscribes to or unsubscribes from audio streams from all remote users.
subscribe | The option whether to unsubscribe from audio streams from all remote users. |
- (int) subscribeRemoteAudio: | (BOOL) | subscribe | |
forUserID: | (uint64_t) | userID | |
Subscribes to or unsubscribes from audio streams from specified remote users.
After a user joins a room, audio streams from all remote users are subscribed by default. You can call this method to subscribe to or unsubscribe from audio streams from all remote users.
subscribe | The option whether to subscribe to specified audio streams. |
userID | The ID of a specified remote user. |
- (int) subscribeRemoteSubStreamVideo: | (BOOL) | subscribe | |
forUserID: | (uint64_t) | userID | |
Subscribes to or unsubscribes from remote video substream for screen sharing.
You can receive the video substream data only after you subscribe to the video substream.
subscribe | The option whether to subscribe to remote video substream for screen sharing. |
userID | The ID of a remote user. |
- (int) subscribeRemoteVideo: | (BOOL) | subscribe | |
forUserID: | (uint64_t) | userID | |
streamType: | (NERtcRemoteVideoStreamType) | streamType | |
Subscribes to or unsubscribes from video streams from specified remote users.
After a user joins a room, the video streams from remote users are not subscribed by default. If you want to view video streams from specified remote users, you can call this method to subscribe to the video streams from the user when the user joins the room or publishes the video streams.
subscribe | The option whether to unsubscribe from local video streams. |
userID | The ID of a specified user. |
streamType | The type of the video streams. For more information, see NERtcRemoteVideoStreamType. |
- (int) takeLocalSnapshot: | (NERtcStreamChannelType) | streamType | |
callback: | (NERtcTakeSnapshotCallback) | callback | |
Takes a local video snapshot.
The takeLocalSnapshot method takes a local video snapshot on the local bigstream or local substream. The callback that belongs to the NERtcTakeSnapshotCallback class returns the data of the snapshot image.
streamType | The video stream type of the snapshot. You can set the value to bigstream or substream. |
callback | The snapshot callback. |
- (int) takeRemoteSnapshot: | (NERtcStreamChannelType) | streamType | |
forUserID: | (uint64_t) | userID | |
callback: | (NERtcTakeSnapshotCallback) | callback | |
Takes a snapshot of a remote video.
The takeRemoteSnapshot method takes a snapshot from the remote video published through the bigstream or substream with a specified uid. The callback that belongs to the NERtcTakeSnapshotCallback class returns the data of the snapshot image.
userID | The ID of a remote user. |
streamType | The video stream type of the snapshot. You can set the value to bigstream or substream. |
callback | The snapshot callback. |
- (int) updateChannelMediaRelay: | (NERtcChannelMediaRelayConfiguration *_Nonnull) | config |
Updates the information of the destination room for media stream relay.
You can call this method to relay the media stream to multiple rooms or exit the current room.
config | The configuration for media stream relay across rooms. For more information, see NERtcChannelMediaRelayConfiguration. |
- (int) updateLiveStreamTask: | (NERtcLiveStreamTaskInfo *) | taskInfo | |
compeltion: | (NERtcLiveStreamCompletion) | completion | |
Updates a streaming task.
taskInfo | The information about the streaming task. For more information, see NERtcLiveStreamTaskInfo. |
completion | The result. The callback is triggered after the method is called. For more information, see NERtcLiveStreamCompletion. |
- (int) uploadSdkInfo |
Uploads the SDK information.
The data that is published contains the log file and the audio dump file.