MS Agent: add interactive animated characters to your applications,
with optional speech output and speech recognition support.
You can download the complete MS Agent toolkit, free of charge, at:
http://www.microsoft.com/workshop/c-frame.htm#/workshop/imedia/agent/default.asp
The following sample, created using the JazzAge ActiveX Factory 'Client Edition' for
PB/DLL and PB/CC, shows how to load an MS Agent character file, dipslay, move
and gesture an animated character, and invoke its speech output capabilities.
You will find the complete and free JazzAge ActiveX factory 2.0 'Client Edition' for PB/DLL and PB/CC
Open Beta3 on our web site: http://www.jazzagesoft.com.
JA 'CE' gives PB developers an immediate and complete access to the latest and most advanced
technologies, only provided as ActiveX object models: ADO (OLE-DB), Office suite (Word, Excel),
Outlook/Exchange, DHTML... One single product lets you develop applications sending SQL
queries to SQL Server, relying on Outlook to send emails or groupware functionalities...
Philippe Monteil
JAZZAge Software
http://www.jazzagesoft.com.
LOCAL pAgent AS DWORD
LOCAL hParameterBlock AS DWORD
LOCAL bconnected AS WORD
LOCAL msg AS STRING
LOCAL pCharacters AS DWORD
LOCAL pCharacter AS DWORD
LOCAL speak AS ASCIIZ*256
' Connect to the MS Agent ActiveX server
pAgent=JACreateActiveXObject("Agent.Control.1")
JASubscribeEvents pAgent,CODEPTR(JAEventCallBack),1
AgentSetCONNECTED pAgent,-1
bconnected=AgentGetCONNECTED(pAgent)
pCharacters=AgentGetCharacters(pAgent)
' Load a characters file
IAgentCtlCharactersLOAD pCharacters,"Merlin",JAValBSTR("d:\jac20\msagent\merlin.acs")
' Connect to one of the characters provided by the loaded file.
pCharacter=IAgentCtlCharactersCHARACTER(pCharacters,"Merlin")
' Display and move the character
IAgentCtlCharacterSHOW pCharacter,0
IAgentCtlCharacterMoveTo pCharacter,500,300,0
IAgentCtlCharacterPlay pCharacter,"GestureRight"
IAgentCtlCharacterPlay pCharacter,"GestureLeft"
IAgentCtlCharacterPlay pCharacter,"Greet"
IAgentCtlCharacterPlay pCharacter,"GreetReturn"
' Speech output
hParameterBlock=JANewParameterBlock
speak="Hello World"
JAAddParameterToBlock hParameterBlock,"Text",speak,%JAVT_LPSTR
IAgentCtlCharacterSPEAK pCharacter,hParameterBlock
' ...
JAReleaseActiveXObject pCharacter
JAReleaseActiveXObject pCharacters
JAReleaseActiveXObject pAgent
Comment