new: 2021-10-30 revised: 2022-04-08
GJDigitalSDK.framework、WebRTC.framework
Development Tools: Xcode
Detailed GJDigitalSDKDemo, key code example:
//One iceserver gets multiple iceserver configurations (relay or cluster), so it is placed in the array
NSMutableArray * stunlist=[[NSMutableArray alloc] init];
DigitalSever * digitalSever=[[DigitalSever alloc] init];
digitalSever.urlStrings=@[@"stun:47.114.110.197:23478"];
digitalSever.username=@"";
digitalSever.credential=@"";
[stunlist addObject:digitalSever];
[DigitalConfig shareConfig].serverIP = @"vshow.guiji.ai";// The signaling control server address
[DigitalConfig shareConfig].servePort = 5222;// Signaling controls the server port
[DigitalConfig shareConfig].robotCode = @"1526099699893932032";/// The robot number is used to select the object to which to dock
[DigitalConfig shareConfig].robotMode = @"bot";//Client-driven
[DigitalConfig shareConfig].iceList = [stunlist copy];///// stun address,ice server
[DigitalConfig shareConfig].userJID = @"iray-proxy-duix@guiji.ai";/// The other side of the conversation id,default iray-proxy@guiji.ai
[DigitalConfig shareConfig].isShowLocalVideo = YES;//Whether to display local video view
[DigitalConfig shareConfig].isShowLocalAudio = YES;/// Whether to play local voice(default YES)
[DigitalConfig shareConfig].isOpenCamera = YES;//Whether to turn on the camera
[DigitalConfig shareConfig].usingFrontCamera = YES;//Whether to use the front camera
[DigitalConfig shareConfig].openAsr = @"true";/// openAsr(Not required)true:Turn on Recognition,false:Do not turn on recognition
[DigitalConfig shareConfig].groupId = @"duix-oversea";/// Internal use dhrtcpc,client us duix-public, default dhrtcdev
[DigitalConfig shareConfig].isAsr = NO;// One sentence recognition(Audio and video are not used):no,Long link recognition:yes,
[DigitalConfig shareConfig].uuid = [NSString stringWithFormat:@"%@", [[DigitalConfig shareConfig] uuidString]];///// Each new session generates a unique number that cannot be repeated
//load the view and agency
[DigitalManager manager].remote_view=self.view;//Remote video
[DigitalManager manager].delegate=self;//angency
[[DigitalManager manager] toStart];//start to communicat
[DigitalManager manager].local_view=self.localView;//local video
/*
Start initializing communication and whether to turn on the local camera / -(void)toStart; /
End communication / -(void)to Stop; /
the client controls the on and off of asr recognition
isOpen yes: open, no: close */
(void)changeAsrEvent:(BOOL)isOpenAsr; /* * Turn on the local camera */
(void)toOpenCamera; /* *Turn off the local camera / -(void)to StopCamera; / * Send speaking content to the central control *robotMode=@"bot" mode sends answer event *robotMode=@"" client mode sends Command event */
(void)sendContent:(NSString )content; / * Send text to the central control (drive mode robotMode is empty). */
(void)commandEvent:(NSString )content; / * Conversation mode with answer event * @param content voice address or text content * @param isAudio is voice (yes:speech, no:text). */
(void)answerCommandEvent:(NSString *)content isAudio:(BOOL)isAudio;
//YES Turn off mute ,NO Mute -(void)setMute:(BOOL)isEnabled;
/* *Interrupt digital person broadcasting */
/* *Agree custom events with the server */
@protocol DigitalViewDelegate @optional /* *Error Message Return Code */
@end