NERtc Unity SDK  V4.5.907
Introduction

CommsEase NERtc SDK provides a comprehensive Real-time Communication (RTC) development platform that allows developers to implement Internet-based peer-to-peer audio and video calls, and group audio and video conferencing. The SDK enables users to manage audio and video devices and switch audio and video modes during calls. The SDK also implements capturing video data callbacks and offers additional features, such as personalized image enhancement.

  • IRtcEngine interface classes that contain main methods invoked by applications.
  • IRtcChannel classes used to implement audio and video calling in a specified room. Users can join multiple rooms by creating multiple IRtcChannel objects.

Room management

Method Description Supported version
Initialize Initializes the NERtc SDK. V4.5.907
Release Destroys an IRtcEngine object. V4.5.907
CreateChannel Creates an RTC channel object. V4.5.907
Destroy Destroys the RTC channel object. V4.5.907
SetChannelProfile Sets a room scene. V4.5.907
SetClientRole Sets the role of a user. V4.5.907
JoinChannel Joins a channel. V4.5.907
LeaveChannel Leaves a channel. V4.5.907
GetConnectionState Gets the connection state of a channel. V4.5.907
SetParameters Sets parameters for audio and video calls. V4.5.907

Room event

Event Description Supported version
OnClientRoleChanged Occurs when a user changes the role in live streaming. V4.5.907
OnJoinChannel Occurs when a user joins a channel. V4.5.907
OnRejoinChannel Occurs when a user rejoins a room. V4.5.907
OnLeaveChannel Occurs when a user leaves a room. V4.5.907
OnUserJoined Occurs when a remote user joins the current room. V4.5.907
OnUserLeft Occurs when a remote user leaves a room. V4.5.907
OnDisconnect Occurs when the server becomes disconnected. callback. V4.5.907
OnReconnectingStart Occurs when reconnection starts. V4.5.907
OnConnectionStateChange Occurs when connection state changes. V4.5.907
OnReleasedHwResources Occurs when a call ends and device resources are released. V4.5.907

Audio management

Method Description Supported version
SetAudioProfile Sets the audio profile. V4.5.907
AdjustRecordingSignalVolume Adjusts the volume of captured signals. V4.5.907
AdjustPlaybackSignalVolume Adjusts the local playback volume. V4.5.907
AdjustUserPlaybackSignalVolume Adjusts the local playback volume of the stream from a specified remote user. V4.5.907
EnableLocalAudio Stops or resumes local audio capture. V4.5.907
MuteLocalAudioStream Mutes or unmutes local audio. V4.5.907
SubscribeRemoteAudioStream Subscribes to or unsubscribes from specified remote audio streams. V4.5.907
SubscribeAllRemoteAudioStream Subscribes to or unsubscribes from all remote audio streams. V4.5.907
EnableLoopbackRecording Enables the capture from a sound card. V4.5.907
AdjustLoopbackRecordingSignalVolume Adjusts the volume of signals captured from a sound card. V4.5.907

Video management

Method Description Supported version
EnableLocalVideo Enables or disables the local video stream. V4.5.907
SetCameraCaptureConfig Sets the configuration for capturing data from a camera V4.5.907
SetVideoConfig Sets the local video configuration. V4.5.907
SetupLocalVideoCanvas Sets the local video canvas. V4.5.907
SetupRemoteVideoCanvas Sets the remote video canvas. V4.5.907
SetLocalRenderMode Sets the rendering mode for the local video stream. V4.5.907
SetRemoteRenderMode Sets the rendering mode of a remote video stream. V4.5.907
StartVideoPreview Starts video preview. V4.5.907
StopVideoPreview Stops video preview V4.5.907
MuteLocalVideoStream Stops or resumes publishing the local video stream. V4.5.907
SubscribeRemoteVideoStream Subscribes to or unsubscribes from video streams from specified remote users. V4.5.907
SetLocalVideoMirrorMode Sets the mirroring mode for the local video stream. V4.5.907
EnableSuperResolution Enables or disables AI super resolution. V4.5.907

Local media events

Method Description Supported version
OnFirstVideoDataReceived Occurs when the first video frame from a remote user is received V4.5.907
OnFirstAudioDataReceived Occurs when the first audio frame from a remote user is received. V4.5.907
OnFirstAudioFrameDecoded Occurs when the first audio frame from a remote user is decoded. V4.5.907
OnFirstVideoFrameDecoded Occurs when the first audio frame from a remote user is decoded. V4.5.907

Remote media event

Method Description Supported version
OnUserAudioStart Called when a remote user enables audio. V4.5.907
OnUserAudioStop Called when a remote user unpublishes the audio substream. V4.5.907
OnUserVideoStart Occurs when a remote user publishes the video stream. V4.5.907
OnUserVideoStop Occurs when a remote user unpublishes the video stream V4.5.907
OnUserVideoProfileUpdate Occurs when the configuration of video streams from a remote user are updated V4.5.907
OnUserAudioMute Occurs when a remote user mutes the audio. V4.5.907
OnUserVideoMute Occurs when a remote user mutes the video. V4.5.907

Screen sharing

Method Description Supported version
StartScreenCaptureByDisplayId Enables screen sharing. The sharing view port is the specified area of a specified screen. This method is only supported on macOS. V4.5.907
StartScreenCaptureByScreenRect Enables screen sharing. The sharing view port is the specified area of a specified screen. This method is only supported on Windows. V4.5.907
StartScreenCaptureByWindowId Enables screen sharing. The sharing view port is the specified area of a specified window. V4.5.907
SetExcludeWindowList Sets the list of windows to be blocked when sharing the specified screen or screen area. V4.5.907
UpdateScreenCaptureRegion Updates the screen sharing area. V4.5.907
PauseScreenCapture Pauses screen sharing. V4.5.907
ResumeScreenCapture Resumes screen sharing. V4.5.907
StopScreenCapture Stops screen sharing. V4.5.907
SetupLocalSubstreamVideoCanvas Sets a playback canvas for local video substream. V4.5.907
SetLocalSubStreamRenderMode Sets the rendering mode of a local video substream. V4.5.907
SetupRemoteSubStreamVideoCanvas Sets a playback canvas for remote video substream. V4.5.907
SetRemoteSubSteamRenderMode Sets the rendering mode of a remote video substream for screen sharing. V4.5.907
SubscribeRemoteVideoSubstream Subscribes to or unsubscribes from the remote video substream for screen sharing. You can receive the video substream data only after you subscribe to the remote video substream. V4.5.907
Event Description Supported version
OnUserSubStreamVideoStart Occurs when a remote user starts screen sharing through the substream. V4.5.907
OnUserSubStreamVideoStop Occurs when a remote user stops screen sharing through the substream. V4.5.907
OnScreenCaptureStatusChanged Occurs when the screen sharing state changes. This method is only supported on Windows. V4.5.907

Multiple room management

Method
Description
Supported version
CreateChannel Create and get a NERtcChannel object. Users can join multiple channels by creating multiple NERtcChannel objects. V4.5.907
IRtcChannel The classes provide methods to implement audio and video calling in a specified room. V4.5.907
Event Description Supported version
ChannelOnClientRoleChanged Occurs when a user changes the role in live streaming. V4.5.907
ChannelOnJoinChannel Occurs when a user joins a channel. V4.5.907
ChannelOnRejoinChannel Occurs when a user rejoins a room. V4.5.907
ChannelOnLeaveChannel Occurs when a user leaves a room. V4.5.907
ChannelOnUserJoined Occurs when a remote user joins the current room. V4.5.907
ChannelOnUserLeft Occurs when a remote user leaves a room. V4.5.907
ChannelOnDisconnect Occurs when the server becomes disconnected. callback. V4.5.907
ChannelOnReconnectingStart Occurs when reconnection starts. V4.5.907
ChannelOnConnectionStateChange Occurs when connection state changes. V4.5.907
ChannelOnReleasedHwResources Occurs when a call ends and device resources are released. V4.5.907
ChannelOnFirstVideoDataReceived Occurs when the first video frame from a remote user is received V4.5.907
ChannelOnFirstAudioDataReceived Occurs when the first audio frame from a remote user is received. V4.5.907
ChannelOnFirstAudioFrameDecoded Occurs when the first audio frame from a remote user is decoded. V4.5.907
ChannelOnFirstVideoFrameDecoded Occurs when the first audio frame from a remote user is decoded. V4.5.907
OnUserAudioStart Called when a remote user enables audio. V4.5.907
OnUserAudioStop Called when a remote user unpublishes the audio substream. V4.5.907
OnUserVideoStart Occurs when a remote user publishes the video stream. V4.5.907
OnUserVideoStop Occurs when a remote user unpublishes the video stream V4.5.907
OnUserVideoProfileUpdate Occurs when the configuration of video streams from a remote user are updated V4.5.907
OnUserAudioMute Occurs when a remote user mutes the audio. V4.5.907
OnUserVideoMute Occurs when a remote user mutes the video. V4.5.907

Music file playback and mixing

Method Description Supported version
StartAudioMixing Starts to play a music file. V4.5.907
StopAudioMixing Stops playing a music file. V4.5.907
PauseAudioMixing Pauses playing a music file. V4.5.907
ResumeAudioMixing Resumes playing a music file. V4.5.907
SetAudioMixingPlaybackVolume Sets the playback volume of a music file. V4.5.907
SetAudioMixingSendVolume Sets the publishing volume of a music file. V4.5.907
GetAudioMixingPlaybackVolume Gets the playback volume of a music file. V4.5.907
GetAudioMixingSendVolume Get the publishing volume of a music file. V4.5.907
GetAudioMixingDuration Gets the total duration of a music file V4.5.907
GetAudioMixingCurrentPosition Sets the playback position of a music file. V4.5.907
SetAudioMixingPosition Gets the current playback position of a music file. V4.5.907
Event Description Supported version
OnAudioMixingStateChanged Occurs when the playback status of a local music file changes. V4.5.907
OnAudioMixingTimestampUpdate Occurs when the timestamp of a music file is updated. V4.5.907

Audio effect file playback management

Method Description Supported version
GetEffectPlaybackVolume Gets the playback volume of an audio effect file. V4.5.907
SetEffectPlaybackVolume Sets the playback volume of an audio effect file. V4.5.907
PlayEffect Plays back a specified audio effect file V4.5.907
StopEffect Stops playing a specified audio effect file. V4.5.907
StopAllEffects Stops playing all audio effect files. V4.5.907
PauseEffect Pauses the playback of an audio effect file. V4.5.907
PauseAllEffects Pauses all audio file playback V4.5.907
ResumeEffect Resumes playing back a specified audio effect file. V4.5.907
ResumeAllEffects Resumes playing back all audio effect files. V4.5.907
SetEffectSendVolume Adjusts the publishing volume of a effect file. V4.5.907
GetEffectSendVolume Gets the publishing volume of an effect file. V4.5.907
Event Description Supported version
OnAudioEffectFinished Occurs when the playback of an audio effect file ends V4.5.907

Voice change and reverberation

Method Description Supported version
SetAudioEffectPreset Sets a voice change effect preset by the SDK. V4.5.907
SetVoiceBeautifierPreset Sets an voice beautifier effect preset by the SDK. V4.5.907
SetLocalVoiceEqualization Sets the local voice equalization effect. You can customize the center frequencies of the local voice effects. V4.5.907
SetLocalVoicePitch Sets the voice pitch of a local voice. V4.5.907

CDN relayed streaming

Note: This methods are applicable only to Interactive Live Streaming v2.0.

Method Description Supported version
AddLiveStreamTask Adds a streaming task in a room. V4.5.907
UpdateLiveStreamTask Updates a streaming task in a room. V4.5.907
RemoveLiveStreamTask Deletes a streaming task in a room. V4.5.907
Event Description Supported version
OnAddLiveStreamTask Occurs when a live streaming task is added. V4.5.907
OnUpdateLiveStreamTask Occurs when a live streaming task is updated. V4.5.907
OnRemoveLiveStreamTask Occurs when a live streaming task is deleted. V4.5.907
OnLiveStreamStateChanged Gets notified of live streaming status. V4.5.907

Media stream relay across channels

Method Description Supported version
StartChannelMediaRelay Starts relaying media streams across channels. V4.5.907
UpdateChannelMediaRelay Updates the information about the destination room to which the media stream is relayed. V4.5.907
StopChannelMediaRelay Stops media stream relay across rooms. V4.5.907
Event Description Supported version
OnMediaRelayStateChanged Occurs when the status of media stream relay changes. V4.5.907
OnMediaRelayEvent Occurs when events about media stream relay are triggered. V4.5.907

Media SEI

Method Description Supported version
nertc.IRtcEngine.SendSEIMsg" SendSEIMsg" Sends supplemental enhancement information (SEI) messages through the bigtream. V4.5.907

Volume reminder

Method Description Supported version
EnableAudioVolumeIndication Enables volume indication for the current speaker. V4.5.907
Event Description Supported version
OnRemoteAudioVolumeIndication Occurs when the system indicates the active speaker and the audio volume. V4.5.907
OnLocalAudioVolumeIndication Occurs when the system indicates current local audio volume in the room. V4.5.907

In-ears monitoring

Method Description Supported version
EnableEarback enables the in-ear monitoring feature. V4.5.907
SetEarbackVolume Sets the volume for in-ear monitoring. V4.5.907

Video dual stream mode

Method Description Supported version
EnableDualStreamMode Enables or disables the video dual stream mode. V4.5.907

Audio and video stream fallback

Method Description Supported version
SetLocalPublishFallbackOption Sets the fallback option for the published local video stream for unreliable network conditions. V4.5.907
SetRemoteSubscribeFallbackOption Sets the fallback option for the subscribed remote audio and video stream for unreliable network conditions. V4.5.907
SetLocalMediaPriority Sets the priority of local media streams. V4.5.907

Network probe testing before calling

Method
Description
Supported version
StartLastmileProbeTest Start network quality probe test before call. V4.5.907
StopLastmileProbeTest Stop network quality probe test before call. V4.5.907
Event
Description
Supported version
OnLastmileQuality Reports the network quality of the local user. V4.5.907
OnLastmileProbeResult Reports the upstream and downstream last mile network quality before calling. V4.5.907

External audio source capture and rendering

Method Description Supported version
SetExternalAudioSource Enables external audio source and sets the capture parameters. V4.5.907
PushExternalAudioFrame Pushs the audio frame data captured from the external audio source to the internal audio engine. V4.5.907
SetExternalAudioRender Sets external audio rendering V4.5.907
PullExternalAudioFrame Pulls the external audio data V4.5.907

External video source capture

Method Description Supported version
SetExternalVideoSource Configures external video source. V4.5.907
PushExternalVideoFrame Pushes the external video frame data captured from the external video source. V4.5.907

Raw audio data

Method Description Supported version
SetRecordingAudioFrameParameters Sets the audio recording format. V4.5.907
SetPlaybackAudioFrameParameters Sets the audio playback format. V4.5.907
SetAudioFrameObserver Registers the audio frame observer. V4.5.907
SetMixedAudioFrameParameters Sets the sample rate of the mixed stream after the audio is captured and playback. You must call this method before you join a room. V4.5.907

Raw video data

Event Description Supported version
OnCaptureVideoFrame Retrieves the video data captured. V4.5.907

Watermark

Method Description Supported version
SetLocalCanvasWatermarkConfigs Adds a watermark to the local video canvas. The method is only supported on Windows. V4.5.907
SetRemoteCanvasWatermarkConfigs Adds a watermark to the remote video canvas. The method is only supported on Windows. V4.5.907

Encryption

Method Description Supported version
EnableEncryption Enables or disables media stream encryption. V4.5.907

Client audio recording

Method Description Supported version
StartAudioRecording Starts an audio recording on a client. V4.5.907
StopAudioRecording Stops an audio recording on the client. V4.5.907
Event Description Supported version
OnAudioRecording Returns the audio recording status. V4.5.907

Audio device management

Method Description Supported version
SetPlayoutDeviceMute Sets the current playback device to a muted state. V4.5.907
GetPlayoutDeviceMute Gets the muted state of the current playback device. V4.5.907
SetRecordDeviceMute Sets the current capture device to a muted state. V4.5.907
GetRecordDeviceMute Gets the muted state of the current capture device. V4.5.907
Event Description Supported version
OnAudioHowling Occurs when howling is detected. V4.5.907

Device management events

Method Description Supported version
OnAudioDeviceStateChanged Occurs when the status of the audio playback device changes. V4.5.907
OnAudioDefaultDeviceChanged Occurs when the default audio device changes. V4.5.907
OnVideoDeviceStateChanged Occurs when the status of a video device changes. V4.5.907

Troubleshooting

Method Description Supported version
StartAudioDump Starts recording an audio dump file that can be used to analyze audio issues V4.5.907
StopAudioDump Stops recording an audio dump file. V4.5.907
UploadSdkInfo Uploads the log records collected by the SDK. V4.5.907
Event Description Supported version
OnError Occurs when an error is triggered. V4.5.907
ChannelOnError Occurs when an error is triggered. V4.5.907
OnWarning Occurs when a warning is triggered. V4.5.907