API reference
ARTCAICallEngine
init
Initializes an engine instance.
public abstract void init(ARTCAICallConfig config);
setAICallAgentType
Specifies the type of an intelligent agent.
public abstract void setAICallAgentType(ARTCAICallAgentType aiAgentType);
call
Creates and starts a call.
public abstract void call(String rtcToken, String aiAgentInstanceId, String aiAgentUserId, String channelId);
handup
Ends a call.
public abstract void handup();
switchMicrophone
Changes the microphone status.
public abstract void switchMicrophone(boolean on);
interruptSpeaking
Interrupts the speech of an intelligent agent.
public abstract boolean interruptSpeaking();
enableVoiceInterrupt
Enables or disables intelligent interruption.
public abstract boolean enableVoiceInterrupt(boolean enable);
enableSpeaker
Enables or disables the speaker.
public abstract boolean enableSpeaker(boolean enable);
enablePushToTalk
Enables or disables the intercom mode.
public abstract boolean enablePushToTalk(boolean enable);
isPushToTalkEnable
Checks whether the intercom mode is enabled.
public abstract boolean isPushToTalkEnable();
startPushToTalk
Starts a speech in intercom mode.
public abstract boolean startPushToTalk();
finishPushToTalk
Ends a speech in intercom mode.
public abstract boolean finishPushToTalk();
cancelPushToTalk
Cancels a speech in intercom mode.
public abstract boolean cancelPushToTalk();
switchRobotVoice
Changes the voice tone.
public abstract boolean switchRobotVoice(String voiceId);
getRobotVoiceId
Queries the voice tone in use.
public abstract String getRobotVoiceId();
setEngineCallback
Configures callback events.
public abstract void setEngineCallback(IARTCAICallEngineCallback engineCallback);
isMicrophoneOn
Checks whether the microphone is enabled.
public abstract boolean isMicrophoneOn();
isSpeakerOn
Checks whether the speaker is enabled.
public abstract boolean isSpeakerOn();
isVoiceInterruptEnable
Checks whether intelligent interruption is enabled.
public abstract boolean isVoiceInterruptEnable();
setAvatarAgentView
Configures a view for a digital human agent.
public abstract void setAvatarAgentView(ViewGroup viewGroup, ViewGroup.LayoutParams avatarLayoutParams);
setVisionPreviewView
Configures a view for local video preview.
public abstract void setVisionPreviewView(ViewGroup viewGroup, ViewGroup.LayoutParams visionLayoutParams);
muteLocalCamera
Turns on or off a camera.
public abstract boolean muteLocalCamera(boolean mute);
isLocalCameraMute
Checks whether a camera is turned off.
public abstract boolean isLocalCameraMute();
switchCamera
Switches between the front camera and the rear camera.
public abstract boolean switchCamera();
getRtcEngine
Queries the information about an RTC engine instance.
public abstract AliRtcEngine getRtcEngine();
getIARTCAICallService
Queries the implementation class of the official protocol.
public abstract IARTCAICallService getIARTCAICallService();
IARTCAICallEngineCallback
onErrorOccurs
An error occurs.
void onErrorOccurs(AICallErrorCode errorCode);
onCallBegin
A call starts and a user joins the meeting.
onCallEnd
A call ends and a user leaves the meeting.
onAICallEngineRobotStateChanged
The status of an intelligent agent changes.
void onAICallEngineRobotStateChanged(ARTCAICallRobotState oldRobotState, ARTCAICallRobotState newRobotState);
onUserSpeaking
A user is speaking.
void onUserSpeaking(boolean isSpeaking);
onUserAsrSubtitleNotify
The speech of a user is recognized by ASR.
void onUserAsrSubtitleNotify(String text, boolean isSentenceEnd, int sentenceId);
onAIAgentSubtitleNotify
An intelligent agent returns a response.
void onAIAgentSubtitleNotify(String text, boolean end, int userAsrSentenceId);
onNetworkStatusChanged
The network status changes.
void onNetworkStatusChanged(String uid, ARTCAICallNetworkQuality quality);
onVoiceVolumeChanged
The voice volume changes.
void onVoiceVolumeChanged(String uid, int volume);
onVoiceIdChanged
The voice tone of the current call changes.
void onVoiceIdChanged(String voiceId);
onVoiceInterrupted
The status of intelligent interruption changes.
void onVoiceInterrupted(boolean enable);
onAgentVideoAvailable
The first video frame of an intelligent agent is ingested.
void onAgentVideoAvailable(boolean available);
onAgentAudioAvailable
The first audio frame of an intelligent agent is ingested.
void onAgentAudioAvailable(boolean available);
onAgentAvatarFirstFrameDrawn
The first frame of a digital human video is rendered.
void onAgentAvatarFirstFrameDrawn();
onUserOnLine
A user is online.
void onUserOnLine(String uid);
onAgentWillLeave
The current intelligent agent is leaving and the call ends.
void onAgentWillLeave(int reason, String message);
onReceivedAgentCustomMessage
A custom message is received from an intelligent agent.
public void onReceivedAgentCustomMessage(String data);
IARTCAICallService
generateAIAgentShareCall
Initiates a request to start a call with a shared intelligent agent.
void generateAIAgentShareCall(String userId, String aiAgentId, ARTCAICallEngine.ARTCAICallAgentType aiAgentType, ARTCAICallEngine.ARTCAICallConfig artcaiCallConfig, IARTCAICallServiceCallback callback);
ARTCAIAgentUtil
parseAiAgentShareInfo
Parses the information about a shared intelligent agent.
public static ARTCAIAgentShareInfo parseAiAgentShareInfo(String shareInfoText);
parseAiAgentInfo
Parses the response of an intelligent agent when the intelligent agent is started.
public static ARTCAIAgentInfo parseAiAgentInfo(JSONObject jsonObject);