Skip to main content
Version: 1.4.x

AIPlayer

Functions

NameDescription
static func setUserKey()set userKey
static func setAppId()set AppId
static func setConfig(config:)Configuring the AIPlayer
config: AI Environment Objects (AIPlayerConfiguration)
static func
create(callbackHandler:)
Returns AIPlayer class with default AI settings on authentication
static func generateToken()Attempt user authentication
static func
getAIList(completionHandler:)
completionHandler (Int: respose code, [String: Any]: AI List, Error: error detail) Returns available AIs as a list
static func aiList()Get AI list
static func
create(name:, callbackHandler:)
name: AI name,
callbackHandler (IAIPlayer: AI class, Error: error detail) Create AI class with a given ai name
static func getSpeakableLanguages(gender:)Gets the list of available languages.
If there is no gender, gets the full list of available.
static func getCustomVoicesWith(language:, gender:)Gets the list of available voices.
Enter language and gender to get only the corresponding list.
static func findCustomVoice(customVoiceId:)Find CustomVoice by id. Return null if there is none
static func loadCustomVoices(completionHandler:)Load a list of available languages and gender-specific voices.
Through closure, nil is delivered when successful, and functions related to voice change after success can be used.
func release()Remove AI class.
func send(text:)Make the ai speak.
func send(texts:)Make the ai speak multiple sentences.
func send(clipset:)Make the ai speak.
func send(clipsets:)Make the ai speak multiple sentences.
func preload(texts:)Preload next sentence.
func stopSpeaking()Stop speech.
func pause()Pause speech.
func resume()Resume speech.
func setCustomVoice(customVoice:)Change AI's voice to the desired CustomVoice. True return on success.
func setCustomVoiceForLanguage(language:, gender:)Change the voice of AI to the desired language. True return on success.
func customVoice()Gets the AIPlayer user-set voice. nil return if no user settings exist.
func reconnect(callbackHandler:)Attempt to reconnect when disconnected.

properties

NameDescription
var nameString { getter } read only
AIPlayer name
var genderString { getter } read only
AIPlayer gender
var languageString { getter } read only
AIPlayer language
var gesturesArray { getter } read only
List of available gestures
var sizeCGSize { getter } read only
AIPlayer size
var scaleCGFloat { getter setter }
get or set AIPlayer size
var volumeFloat { getter setter }
get or set AIPlayer volume
var isMuteBool { getter setter }
get or set AIPlayer mute
var speechSpeedFloat { getter setter }
get or set AI speech rate
var enableViewAspectRatioBool { getter }
AIPlayer View Size aspect Ratio Optimization Enabled
var verticalAlignmentAIPlayerVerticalAlignment { getter setter }
AI vertical alignment on size update
var horizontalAlignmentAIPlayerHorizontalAlignment {getter setter }
AI horizontal alignment on size update
var stateAIState { getter } read only
AIPlayer state
var isConnectedBool { getter } read only
AI connection status
var canPreloadBool { getter } read only
Preloadable status