Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help wanted on Speech Recognition
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00436614
Message ID:
00450617
Views:
40
Hi Derek,

Here's a quick sample:
lcCharFile = "C:\WINNT\msagent\chars\merlin.acs"
* Change path above to point to your ACS file

with Thisform.oAgent
	.Characters.Load("MyCharacter", lcCharFile)
	.Characters("MyCharacter").SoundEffectsOn = .f.
	with .Characters("MyCharacter")
		.Show()
		nLeft = Thisform.Left+Thisform.oAgent.Left
		nTop = Thisform.Top+Thisform.oAgent.Top
		.MoveTo(nLeft,nTop)
		.Play("Greet")

		* Add commands that may be spoken or selected
		* from context menu
		with .Commands
			.Add("One", "&1", "1")
			.Add("Two", "&2", "2")
			.Add("Three", "&3", "3")
			.Add("Four", "&4", "4")
			.Add("Five", "&5", "5")
		endwith

		* Turn listen mode on
		.listen(.t.)
	endwith
endwith
In the Agent.Command Event:
*** ActiveX Control Event ***
LPARAMETERS userinput

*Speak the command the user spoke/selected
Thisform.oAgent.Characters("MyCharacter").Speak(userinput.name)
Note that the user can invoke listening mode by pressing the hotkey. The default hot key is Scroll Lock.

>Hi All
>I am trying to use the MSAGENT for activating certain command within my VFP5 application. The only input I need is the character set 1 to 9. I have no problem activating the specified agent and getting it to speak. What I can't seem to master is how to get it to listen and respond to what it hears. Any sample code would be gratefully received. I have documented what I have so far (Not much I know!)
kenweber
GCom2 Solutions
Microsoft Certified Professional

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform