-
I have a few questions regarding the MsAgent control.
Is there any way to make the character pop up at a certain point, instead of in the upper-left corner of the screen?
How do I make him listen and react to the words spoken by the user? I.e.
Code:
If UserSpeech = "This" Then
'Do this
Else
'Do this
End If
Can anyone help? I've looked everywhere!
-
I have mailed you some sample projects. check it out
-
the agent has to be loaded before he accepts voice commands, then you can add a voice command to his menu :)
also, you can move him around, why don't you just download the cap project from msdn???
this has most of this informatiopn enclosed :)
-
Please help, I am tryin to get more information about using the MSagent with voice commands.
Couldn't find any information that shows how to do it.
-
Code:
If Text1.text = "Can't we all just go to Vb-World?" Then
Speaker1.Speak "Sure we can."
Else
Speaker1.Speak "Don't forget to visit the Forums today."
End If
-
that's very nice :-) but it doesn't help me with voice commands (me speaking to a microphone, agent -> do stuff) ..
-
To add commands to an agent do this:
First, If you have Microsoft Command and Control installed and a microphone then you should be able to say "Open Voice Commands Window" anytime to the agent. Make sure that works before trying to program your own commands. The voice commands windows is the list of all the things you can say to your agent. Now, to add commands to the window type this.
Lets assume that the agent control is on form1, its called agent1 and the agent ID is merlin. Lets also assume that the agent works (you can see it on the screen when you run the program).
Code:
Private Sub Form_Load()
Form1.Agent1.Characters("Merlin").Commands.add "Exit","Quit","(Quit|Exit|End)",True,True
End Sub
' What That Does is add a command named "Exit" with the caption as quit, lets you say either Quit Exit or End, sets enabled to true and visible to true. Visible means if you can see it when you right-click on the agent.
' Now, to make the command so it does something, do this:
' This should me put in the command sub in the agent control
Private Sub Agent1_Command(ByVal UserInput As Object)
Select Case UserInput.name
Case "Exit" ' Remember that we named the command "Exit" above
End ' End the Program
End Select
End Sub
' This makes it so when the user activates the command named Exit (by saying Quit, Exit, or End) it Ends the program. Not to hard huh?
If you have any other problems or questions, feel free to e-mail me. Also, beleve it or not, Microsoft has a really good section on MS Agnet programming. Just visit http://www.microsoft.com/msagent
Regards,
Eric Butler