Skip to main content
Version: Latest

AIPlayer

namespace AIHuman.View

Modifier and TypeMethod / Property Description
voidInit(string aiName, IAIPlayerCallback callback, IFrameImageProvider imageProvider) Initialize AIPlayer with the aiName received as a factor and register callback for health monitoring and image provider for AI rendering. (valid only when authenticated)
voidSend(string[] requests) Let the AI speak. (using pure-text string)
voidSend(AIClipSet[] requests) Let the AI play. (using AIHuman.Model.AIClipSet)
voidStopSpeaking(bool forced = false) Stop the current conversation. It also deletes the content in the speaking queue. If forced is true, stop the gesture in play as well.
voidPause() Pauses speaking.
voidResume() Continue speaking again from when it was paused.
voidPreload(string[] requests) Prepare the sentences to be spoken in advance.
voidPreload(AIClipSet[] requests) Prepare the clips to be play in advance.
List<AIGesture>GetGestures() Get a list of gesture. (available gestures)
boolSetCustomVoice(CustomVoice cv) Set AI's voice to cv. return true if success.
CustomVoiceGetCustomVoice() Get the current CustomVoice object of set ai. It returns null if not set.
boolSetCustomVoiceForLanguage(string languageCode, string gender) Set the voice by the desired language and gender. All available languages when language null is entered, and all genders when null is entered in gender are searched and set as the first voice. If it succeeds, it returns true. Otherwise the default voice will be set.
voidDispose() Called when release AIPlayer.
boolAutoReconnect { get; set; } Automatically set up AI reconnection attempts.
floatSpeed { get; set; } Get or Set the AI's speech rate.
floatScale { get; set; } Get or Set the AI's scale.
floatVolume { get; set; } Get or Set the AI's volume.
boolIsMute { get; set; } Get or Set the AI's Mute.
AIPlayerStateState { get; } Get the state of AIPlayer
stringAIName { get; } Get the AI name.
stringAIGender { get; } Get the AI gender.
stringAILanguage { get; } Get the AI language.
boolCanPreload { get; } It brings whether AI is in a preloadable state.
boolIsConnected { get; } It brings whether AI is connected.
voidReconnect(int attempts = 5, int delay = 3000, Action<bool> callback = null) Attempt to reconnect AI. Return the reconnection result via callback. delay is millisecond
voidDisconnect(Action<bool> callback = null) Disconnect AI. Returns the result of disconnection via callback.