|
-
Nov 13th, 2008, 03:44 AM
#1
Thread Starter
New Member
code doesn't run (on an XP machine)?
I am trying to use MS Speech SDK in Visual Basic. Can you see why this
> code doesn't run (on an XP machine)?
> The code compiles OK and the form comes up when I run the app but I
> don't even get my first print statement (Label1.Text = "Form Loaded").
>
> Option Explicit Off
>
> Imports SpeechLib
>
> Public Class Form1
> Public WithEvents RC As SpSharedRecoContext
> Public myGrammar, b As ISpeechRecoGrammar
>
> Private Sub Form1_Load()
> RC = New SpSharedRecoContext
> Label1.Text = "Form Loaded"
> myGrammar = RC.CreateGrammar
> myGrammar.CmdLoadFromFile("e:\SolApp\sol.xml", SLODynamic)
> myGrammar.CmdSetRuleIdState(0, SGDSActive)
> Label1.Text = "Grammar Loaded"
> End Sub
Private Sub RC_FalseRecognition(ByVal StreamNumber As Long, ByVal
StreamPosition As Object, ByVal Result As SpeechLib.ISpeechRecoResult)
Label1.Text = "(no recognition)"
End Sub
Private Sub RC_Recognition(ByVal StreamNumber As Long, ByVal
StreamPosition As Object, ByVal RecognitionType As
SpeechLib.SpeechRecognitionType, ByVal Result As
SpeechLib.ISpeechRecoResult)
Label1.Text = Result.PhraseInfo.GetText
End Sub
End Class
-
Nov 13th, 2008, 04:57 AM
#2
Fanatic Member
Re: code doesn't run (on an XP machine)?
When you say 'its not running on XP machine'..is it working fine on another environment? BTW, what is SpSharedRecoContext? Do you have reference added to this object?
-
Nov 13th, 2008, 05:03 AM
#3
Re: code doesn't run (on an XP machine)?
-
Nov 13th, 2008, 11:51 PM
#4
Thread Starter
New Member
Re: code doesn't run (on an XP machine)?
hi .....
thanks for quick reply...
i added MS Speech SDK 5.1 from microsoft web.. really im not a vb programmer... i typed this in vb.net .. but there were no error msgs..... and this is for my friends final year project codes...
please reply me..
thank you
-
Nov 14th, 2008, 01:19 AM
#5
Fanatic Member
Re: code doesn't run (on an XP machine)?
Hmmm... so you are putting in efforts for your friend eh?! Must be a girl friend or a boy friend 
Anyway, you didnt reply to my question. Does it work in any other environment - other than Windows XP?
One more question - does your application hang after loading the form?
Try debugging the application by putting a break point at form load event.
All the best
-
Nov 14th, 2008, 01:30 AM
#6
Re: code doesn't run (on an XP machine)?
You're not a VB programmer yet you're doing this for your friend's final year project? What has your friend been doing for the duration of the course? It's not really appropriate that we help you help your friend cheat on their final year project.
-
Nov 14th, 2008, 01:36 AM
#7
Thread Starter
New Member
Re: code doesn't run (on an XP machine)?
hi...
its not for girl hehe.. but really its very big helpto me....
noo i didnt run it on XP.. he sent to me this error and i passed it to forums.. but actually i dont know this code is vb or vb.net .....just i paste this in vb.net and checked.. only this codes work...
Option Explicit Off
Imports SpeechLib
Public Class Form1
Public WithEvents RC As SpSharedRecoContext
Public myGrammar, b As ISpeechRecoGrammar
Private Sub Form1_Load()
RC = New SpSharedRecoContext
Label1.Text = "Form Loaded"
myGrammar = RC.CreateGrammar
myGrammar.CmdLoadFromFile("e:\SolApp\sol.xml", SLODynamic)
myGrammar.CmdSetRuleIdState(0, SGDSActive)
Label1.Text = "Grammar Loaded"
End Sub
My big problem is how this function work.....
Private Sub RC_FalseRecognition(ByVal StreamNumber As Long, ByVal
StreamPosition As Object, ByVal Result As SpeechLib.ISpeechRecoResult)
Label1.Text = "(no recognition)"
End Sub
Private Sub RC_Recognition(ByVal StreamNumber As Long, ByVal
StreamPosition As Object, ByVal RecognitionType As
SpeechLib.SpeechRecognitionType, ByVal Result As
SpeechLib.ISpeechRecoResult)
Label1.Text = Result.PhraseInfo.GetText
End Sub
thank you
-
Nov 14th, 2008, 01:49 AM
#8
Fanatic Member
Re: code doesn't run (on an XP machine)?
You just copied and pasted the code that your friend sent! You are not sure about the code! And you are expecting us to understand it magically so that you could help your so called friend?!
Buddy life is not that easy
-
Nov 14th, 2008, 01:49 AM
#9
Thread Starter
New Member
Re: code doesn't run (on an XP machine)?
hi...
its not for girl hehe.. but really its very big helpto me....
noo i didnt run it on XP.. he sent to me this error and i passed it to forums.. but actually i dont know this code is vb or vb.net .....just i paste this in vb.net and checked.. only this codes work...
Option Explicit Off
Imports SpeechLib
Public Class Form1
Public WithEvents RC As SpSharedRecoContext
Public myGrammar, b As ISpeechRecoGrammar
Private Sub Form1_Load()
RC = New SpSharedRecoContext
Label1.Text = "Form Loaded"
myGrammar = RC.CreateGrammar
myGrammar.CmdLoadFromFile("e:\SolApp\sol.xml", SLODynamic)
myGrammar.CmdSetRuleIdState(0, SGDSActive)
Label1.Text = "Grammar Loaded"
End Sub
My big problem is how this function work.....
Private Sub RC_FalseRecognition(ByVal StreamNumber As Long, ByVal
StreamPosition As Object, ByVal Result As SpeechLib.ISpeechRecoResult)
Label1.Text = "(no recognition)"
End Sub
Private Sub RC_Recognition(ByVal StreamNumber As Long, ByVal
StreamPosition As Object, ByVal RecognitionType As
SpeechLib.SpeechRecognitionType, ByVal Result As
SpeechLib.ISpeechRecoResult)
Label1.Text = Result.PhraseInfo.GetText
End Sub
thank you
-
Nov 14th, 2008, 02:00 AM
#10
Thread Starter
New Member
Re: code doesn't run (on an XP machine)?
Thankyou verymuch for your advice and thanks for help ... Im doing c# asp so i dont have any experienc e abt this.. normally our c# site forums we are checkig and sending answers .. but you just ask.. may be all of u to havent much idea abt this ....
-
Nov 14th, 2008, 02:15 AM
#11
Fanatic Member
Re: code doesn't run (on an XP machine)?
 Originally Posted by msbsam
Thankyou verymuch for your advice and thanks for help ... Im doing c# asp so i dont have any experienc e abt this.. normally our c# site forums we are checkig and sending answers .. but you just ask.. may be all of u to havent much idea abt this .... 
Look who's talking!!
You say you know C# and not VB. You are talking about just two different languages. The concepts are the same. If you know OOP concepts, language is merely a barrier. Anyway, dont keep this attitude if you are expecting help from others.
-
Nov 14th, 2008, 02:29 AM
#12
Thread Starter
New Member
Re: code doesn't run (on an XP machine)?
You say you know C# and not VB. You are talking about just two different languages. The concepts are the same. If you know OOP concepts, language is merely a barrier. Anyway, dont keep this attitude if you are expecting help from others.
no sry.. just i said i dont know vb oe vb.net .. asked help from this site. but i said what i know abt this problem...
-
Nov 14th, 2008, 03:00 AM
#13
Re: code doesn't run (on an XP machine)?
Lets all just try to get along 
 Originally Posted by msbsam
Code:
Option Explicit Off
Imports SpeechLib
Public Class Form1
Public WithEvents RC As SpSharedRecoContext
Public myGrammar, b As ISpeechRecoGrammar
Private Sub Form1_Load()
RC = New SpSharedRecoContext
Label1.Text = "Form Loaded"
myGrammar = RC.CreateGrammar
myGrammar.CmdLoadFromFile("e:\SolApp\sol.xml", SLODynamic)
myGrammar.CmdSetRuleIdState(0, SGDSActive)
Label1.Text = "Grammar Loaded"
End Sub
The line "Form1_Load()" procedure doesnt have the correct procedure signature.
It should look like...
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Without the form load event having a proper event handler it will never fire so your speech object may not be initialized to run.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 14th, 2008, 04:41 AM
#14
Thread Starter
New Member
Re: code doesn't run (on an XP machine)?
Thank you RobDog888 replied....
But still it not comming any sounds.... This is my code.. Now it has form load event . I want to know how to work this two methods..
Private Sub RC_FalseRecognition(ByVal StreamNumber As Long, ByVal
StreamPosition As Object, ByVal Result As SpeechLib.ISpeechRecoResult)
Label1.Text = "(no recognition)"
End Sub
Private Sub RC_Recognition(ByVal StreamNumber As Long, ByVal
StreamPosition As Object, ByVal RecognitionType As
SpeechLib.SpeechRecognitionType, ByVal Result As
SpeechLib.ISpeechRecoResult)
Label1.Text = Result.PhraseInfo.GetText
End Sub
Thank you ....
Please reply
-
Nov 14th, 2008, 04:55 AM
#15
Re: code doesn't run (on an XP machine)?
Have you checked the documentation in the SDK yet?
Perhaps this link may be easier
http://www.autoitscript.com/forum/in...ch+recognition
This should help insure your mic is adjusted/working.
http://gotspeech.net/forums/thread/6908.aspx
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 14th, 2008, 09:18 AM
#16
Fanatic Member
Re: code doesn't run (on an XP machine)?
I do not condone the act of cheating on tests purely for the fact that I was never allowed to do so.
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
|