NERtcEngine class

NERtc 核心接口

Constructors

NERtcEngine()
factory

Properties

audioEffectManager NERtcAudioEffectManager
获取音效管理模块
no setter
audioMixingManager NERtcAudioMixingManager
获取伴音管理模块
no setter
deviceManager NERtcDeviceManager
获取设备管理模块
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addLiveStreamTask(NERtcLiveStreamTaskInfo taskInfo, AddLiveTaskCallback? callback) Future<int>
添加房间推流任务,成功添加后当前用户可以收到该直播流的状态通知。通话中有效。 taskInfo 直播任务信息 AddLiveTaskCallback 操作结果回调,方法调用成功才有回调
adjustPlaybackSignalVolume(int volume) Future<int>
调节播放音量 加入频道前后都可以调用 调节范围为:0~400 0: 静音 100: 原始音量 (默认) 400: 最大可为原始音量的 4 倍(自带溢出保护)
adjustRecordingSignalVolume(int volume) Future<int>
调节录音音量 加入频道前后都可以调用 调节范围为:0~400 0: 静音 100: 原始音量 (默认) 400: 最大可为原始音量的 4 倍(自带溢出保护)
adjustUserPlaybackSignalVolume(int uid, int volume) Future<int>
调节本地播放的指定远端用户的信号音量。
clearStatsEventCallback() Future<int>
取消统计监听
create({required String appKey, required NERtcChannelEventCallback channelEventCallback, NERtcOptions? options}) Future<int>
创建 NERtc 实例
enableAudioVolumeIndication(bool enable, int interval) Future<int>
启用说话者音量提示。该方法允许 SDK 定期向 App 反馈当前谁在说话以及说话者的音量
enableDualStreamMode(bool enable) Future<int>
是否开启双流模式
enableEncryption(bool enable, NERtcEncryptionConfig config) Future<int>
开启或关闭媒体流加密。
enableLocalAudio(bool enable) Future<int>
开启/关闭本地语音(采集和发送)
enableLocalVideo(bool enable) Future<int>
开启/关闭本地视频采集以及发送
enableSuperResolution(bool enable) Future<int>
启用或停止 AI 超分。 使用 AI 超分功能之前,请联系技术支持开通 AI 超分功能。 AI 超分仅对以下类型的视频流有效:
getConnectionState() Future<int>
获取连接状态
joinChannel(String? token, String channelName, int uid) Future<int>
加入音视频房间。
leaveChannel() Future<int>
离开频道.
muteLocalAudioStream(bool mute) Future<int>
开关本地音频发送。该方法用于允许/禁止往网络发送本地音频流。
muteLocalVideoStream(bool mute) Future<int>
开关本地视频发送
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
release() Future<int>
销毁 NERtc实例,释放资源
removeLiveStreamTask(String taskId, DeleteLiveTaskCallback? callback) Future<int>
删除房间推流任务。通话中有效
sendSEIMsg(String seiMsg, {int streamType = NERtcVideoStreamType.main}) Future<int>
发送 SEI 信息 默认使用主流通道发送SEI 信息 接收SEI信息参考 NERtcChannelEventCallback.onReceiveSEIMsg 本接口有以下限制:
setAudioEffectPreset(int preset) Future<int>
设置 SDK 预设的人声的变声音效。
设置变声音效可以将人声原因调整为多种特殊效果,改变声音特性。
setAudioProfile(NERtcAudioProfile profile, NERtcAudioScenario scenario) Future<int>
设置音频场景与模式,必须在 init 前设置有效。
setCameraCaptureConfig(NERtcCameraCaptureConfig captureConfig) Future<int>
设置本地摄像头的采集偏好等配置。
setChannelProfile(int channelProfile) Future<int>
设置频道场景 只能在加入频道之前调用 SDK 会根据不同的使用场景采用不同的优化策略,通信场景偏好流畅,直播场景偏好画质。
setClientRole(int role) Future<int>
设置用户角色 在加入频道前或在频道中,用户可以通过setClientRole 接口设置本端模式为观众或主播模式。 role 用户角色. NERtcClientRole
setLocalMediaPriority(int priority, bool isPreemptive) Future<int>
设置本地用户的媒体流优先级。
setLocalPublishFallbackOption(int option) Future<int>
设置弱网条件下发布的音视频流回退选项。
setLocalVideoConfig(NERtcVideoConfig videoConfig) Future<int>
设置视频编码属性。
setLocalVoiceEqualization(int bandFrequency, int bandGain) Future<int>
设置本地语音音效均衡,即自定义设置本地人声均衡波段的中心频率。
setLocalVoicePitch(double pitch) Future<int>
设置本地语音音调。
该方法改变本地说话人声音的音调。
setRemoteSubscribeFallbackOption(int option) Future<int>
设置弱网条件下订阅的音视频流回退选项。
setStatsEventCallback(NERtcStatsEventCallback callback) Future<int>
设置统计监听
setVoiceBeautifierPreset(int preset) Future<int>
设置 SDK 预设的美声效果。
调用该方法可以为本地发流用户设置 SDK 预设的人声美声效果。
startAudioDump() Future<int>
开始音频dump
startAudioRecording(String filePath, int sampleRate, int quality) Future<int>
开始客户端录音。
startChannelMediaRelay(NERtcChannelMediaRelayConfiguration config) Future<int>
开始跨房间媒体流转发。
startScreenCapture(NERtcScreenConfig config) Future<int>
开启辅流形式的屏幕共享
startVideoPreview() Future<int>
开启视频预览
stopAudioDump() Future<int>
结束音频dump
stopAudioRecording() Future<int>
停止客户端录音。
stopChannelMediaRelay() Future<int>
停止跨房间媒体流转发。
stopScreenCapture() Future<int>
关闭辅流形式的屏幕共享
stopVideoPreview() Future<int>
停止视频预览
subscribeAllRemoteAudio(bool subscribe) Future<int>
订阅/取消订阅所有用户音频(后续加入的用户也同样生效)
subscribeRemoteAudio(int uid, bool subscribe) Future<int>
订阅/取消订阅指定用户音频流
subscribeRemoteSubStreamVideo(int uid, bool subscribe) Future<int>
订阅或取消订阅别人的辅流视频
subscribeRemoteVideo(int uid, int streamType, bool subscribe) Future<int>
订阅或取消订阅指定远端用户的视频流
switchChannel(String? token, String channelName) Future<int>
快速切换音视频房间。
房间场景为直播场景时,房间中角色为观众的成员可以调用该方法从当前房间快速切换至另一个房间。
成功调用该方切换房间后:
toString() String
A string representation of this object.
inherited
updateChannelMediaRelay(NERtcChannelMediaRelayConfiguration config) Future<int>
更新媒体流转发的目标房间。
updateLiveStreamTask(NERtcLiveStreamTaskInfo taskInfo, UpdateLiveTaskCallback? callback) Future<int>
更新修改房间推流任务。通话中有效。 taskInfo 直播任务信息 UpdateLiveTaskCallback 操作结果回调,方法调用成功才有回调
uploadSdkInfo() Future<int>
上传SDK日志信息 只能在加入频道后调用

Operators

operator ==(Object other) bool
The equality operator.
inherited