|
-
Mar 7th, 2006, 02:36 PM
#1
Thread Starter
New Member
trying to manipulate an automation process
dear all.. my name is Kwei from malaysia m currently doing my final year honors project which is a smart voice enabled english learning tool for visual impaired kids.. using vb.net with microsoft agent to spice up the smartness of the system, i have a problem that i m not able to figure out...my desired output is to make the agent n the loop structure run the whole tutorial without user pressing any keypress to go to the next question. i had tried enabling n disabling the textbox but things just dun go rite... need help or advice my viva is coming real soon below are my code portion for the problem with comments of deisred output n problem faced.
[Highlight=VB]/*on keypress ENTER key it is suppose to run on its on just like an automation turotrial
Case "SPACE"
mSpk2.Stop()
mSpk2.Speak("Here we go!!!!!")
Do Until loop_random = 10
generated_random_number = RandomNumber.Next(1, 26)
If RandomNumber.Next(1, 26) = 1 Then
mSpk2.Stop()
mSpk2.Speak("A is for?")
If strKeyPress.ToUpper() = "ENTER" And TextBox1.Text = "APPLE" Then/* when compiler reaches here it will straight go to the else result without even lettin me to input text into the textbox..i think this is where the real problem lies..hope anyone at all could give a hand or advice..it will be most appreciated"
mSpk2.Stop()
mSpk2.Speak("Bravo! A is for Apple.")
mSpk2.Speak("A,P,P,L,E Apple.")
loop_random = loop_random + 1
Else
mSpk2.Speak("Oops!! You are wrong!!!")
mSpk2.Speak("A is for Apple.")
mSpk2.Speak("A,P,P,L,E Apple.")
mSpk2.Speak("Next Question is ")
loop_random = loop_random + 1
End If
ElseIf RandomNumber.Next(1, 26) = 2 Then
mSpk2.Stop()
mSpk2.Speak("B is for?")
If strKeyPress.ToUpper() = "ENTER" And TextBox1.Text = "BALL" Then
mSpk2.Stop()
mSpk2.Speak("Bravo! B is for Ball.")
mSpk2.Speak("B,A,L,L Ball.")
loop_random = loop_random + 1
Else
mSpk2.Speak("Oops!! You are wrong!!!")
mSpk2.Speak("B is for Ball.")
mSpk2.Speak("B,A,L,L Ball.")
mSpk2.Speak("Next Question is ")
loop_random = loop_random + 1
End If
-
Mar 7th, 2006, 03:31 PM
#2
Re: trying to manipulate an automation process
Welcome to VBF 
Unfortunately, there's alot of important information that your code isn't telling us. FOr instance, how/when do you populate "strKeyPress?" Also, how/when is this snippet being called?
-
Mar 7th, 2006, 10:51 PM
#3
Thread Starter
New Member
Re: trying to manipulate an automation process
thanks for replyin me sir, sorry silly me .. on form load it will load the agent n blah some instruction. instruction will go like to start doing tutorial pls press the space key n stuff like that..when user acknowledge the instruction they would just press the space button..n would kick the strkeypress = " ENTER" hope to hear from u real soon i will have to show this function to my supervisors tommorow n i m like new in vb.net coz they didnt allow us to use prog langguage which is not so accepted in the market world today sotherefore vb.net is a whole new world.. to me.. pls help n guide me guess i will paste the whole form code to make yer references easier
regards,
K
VB Code:
Private Sub ABClesson_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim voice As SpVoice
voice = New SpVoice
AxAgent1.Characters.Load("Vrgirl", "C:\WINDOWS\msagent\chars\Vrgirl.acs")
mSpk2 = AxAgent1.Characters("Vrgirl")
mSpk2.Show(0)
mSpk2.Play("Greet")
mSpk2.Play("Alert")
mSpk2.Speak("You choose to do some ABC tutorial with me!")
mSpk2.Speak("Great!!!")
mSpk2.Speak("Are you ready to do some ABC tutorial with me?")
mSpk2.Play("Alert")
mSpk2.Speak("Choice 1, To begin!,Please, press the Space key to start doing Smart ABC tutorial!")
mSpk2.Speak("To erase spelling error, please press the Enter key on your keyboard.")
mSpk2.Speak("Choice 2, To return to main menu please press the Escape key on your keyboard")
mSpk2.Speak("Choice 3, To repeat instructions please press the Shift key on your keyboard")
mSpk2.Play("Alert")
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|