AliAiCall class

阿里云 AI 通话插件 提供了与 AI 通话相关的所有功能接口

Constructors

AliAiCall()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

call({required String rtcToken, required String aiAgentInstanceId, required String aiAgentUserId, required String channelId}) Future<void>
发起通话 rtcToken RTC通话令牌 aiAgentInstanceId AI代理实例ID aiAgentUserId AI代理用户ID channelId 通话频道ID
enableSpeaker(bool enable) Future<void>
切换扬声器状态 enable true开启,false关闭
enableVoiceInterrupt(bool enable) Future<void>
启用/禁用语音打断功能 enable true启用,false禁用
hangup() Future<void>
挂断通话
initEngine({required String userId}) Future<void>
初始化引擎 userId 用户ID
interruptSpeaking() Future<void>
打断AI说话
setAIRole(String roleId, String roleName) Future<void>
设置AI角色 roleId 角色ID roleName 角色名称
setEngineEventHandler({void onCallBegin()?, void onCallEnd()?, void onError(String)?, void onUserSpeaking(bool)?, void onNetworkQuality(int)?, void onVideoSizeChanged(Map<String, int>)?, void onVoiceIdChanged(String)?, void onRoleChanged(String)?, void onAIAgentStateChanged(String)?, void onUserAsrSubtitleNotify(Map<String, dynamic>)?, void onAIAgentSubtitleNotify(Map<String, dynamic>)?, void onVolumeChanged(Map<String, dynamic>)?}) → void
设置引擎回调函数
switchMicrophone(bool on) Future<void>
切换麦克风状态 on true开启,false关闭
switchRobotVoice(String voiceId) Future<void>
切换AI机器人声音 voiceId 声音ID