Results 1 to 20 of 20

Thread: Microsoft .NET Speech SDK Beta 2 ! How much u know?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2003
    Location
    USA
    Posts
    31

    Exclamation Microsoft .NET Speech SDK Beta 2 ! How much u know?

    I am downloading the Microsoft .NET Speech SDK Beta 2.
    Can this speech engine develop .NET window application?
    I read on the documentation, it just say to develop a
    speech web application..but never mention about window
    application.

    anyone of you know about .NET Speech?
    Best Regards,
    May C

  2. #2
    Junior Member 347Studboy's Avatar
    Join Date
    Apr 2003
    Location
    New Milford, Inthemiddleofnowhere
    Posts
    17
    Hello all! I'm glad I found this topic so fast... I need help with Speech recognition as well. See, I want to figure out how to use the sample coding in the SDK, but they were all programmed in VB6, and I can't open the projects because I don't have VB.Net Proffesional. So, all I need to know is where I can get information on using the voice recognition events in VB.Net... or however you use Speech Recognition to control applicaitons.
    You might see me on the Neo Productions forums!

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    You maybe have a look at these links(two examples at the bottom) http://www.c-sharpcorner.com/SpeechNet.asp

    http://www.speechstudio.com/suite.htm

  4. #4
    Junior Member 347Studboy's Avatar
    Join Date
    Apr 2003
    Location
    New Milford, Inthemiddleofnowhere
    Posts
    17
    Thanks a bunch! I appreciate the help.
    You might see me on the Neo Productions forums!

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Sure ! much more stuff if you just google the net !

  6. #6
    Junior Member 347Studboy's Avatar
    Join Date
    Apr 2003
    Location
    New Milford, Inthemiddleofnowhere
    Posts
    17
    Okay... so I found the kind of code I've been looking for! Go Here to see the page. Unfortunately, whenever I try to use the code, I get an error... I think the "Set" function works differently in VB.Net, but I'm not sure how to use it. Any ideas?
    You might see me on the Neo Productions forums!

  7. #7
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    No more Set keywords in VB.NET . Can you post the code that uses Set keyword ?

  8. #8
    Junior Member 347Studboy's Avatar
    Join Date
    Apr 2003
    Location
    New Milford, Inthemiddleofnowhere
    Posts
    17
    VB Code:
    1. 'To use the Text to Speech interface, we would use the following code:
    2.  
    3. Dim Voice As SpVoice
    4. Set Voice = New SpVoice
    5. Voice.Speak "Howdy!" ,SVSFlagsAsync
    6.  
    7. 'I don't think it could get much easier!
    8.  
    9. 'And to use the Speech Recognition classes, we would do the following:
    10.  
    11.  
    12. Dim WithEvents RecoContext As SpSharedRecoContext
    13. Dim Grammar As ISpeechRecoGrammar
    14. Set RecoContext = New SpSharedRecoContext
    15. Set Grammar = RecoContext.CreateGrammar(1)
    16. Grammar.DictationLoad
    17. Grammar.DictationSetState SGDSActive
    18.  
    19. ' the following is the event handler for the recognition event...
    20. Private Sub RecoContext_Recognition(ByVal StreamNumber As Long, _
    21. ByVal StreamPosition As Variant, _
    22. ByVal RecognitionType As SpeechRecognitionType, _
    23. ByVal Result As ISpeechRecoResult _
    24. )
    25. Dim strText As String
    26.  
    27. ' put strText in a TextBox, or whatever..
    28. strText = Result.PhraseInfo.GetText.
    29.  
    30. End Sub

    I tried to use this code, but like you confirmed for me, "Set" is no longer used in VB.Net.
    Last edited by 347Studboy; Apr 20th, 2003 at 10:32 AM.
    You might see me on the Neo Productions forums!

  9. #9
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Try this now ...
    VB Code:
    1. 'To use the Text to Speech interface, we would use the following code:
    2.  
    3. Dim Voice As SpVoice
    4. Voice = New SpVoice
    5. Voice.Speak "Howdy!" ,SVSFlagsAsync
    6.  
    7. 'I don't think it could get much easier!
    8.  
    9. 'And to use the Speech Recognition classes, we would do the following:
    10.  
    11.  
    12. Dim WithEvents RecoContext As SpSharedRecoContext
    13. Dim Grammar As ISpeechRecoGrammar
    14. Dim RecoContext = New SpSharedRecoContext
    15. Grammar = RecoContext.CreateGrammar(1)
    16. Grammar.DictationLoad
    17. Grammar.DictationSetState SGDSActive
    18.  
    19. ' the following is the event handler for the recognition event...
    20. Private Sub RecoContext_Recognition(ByVal StreamNumber As Long, _
    21. ByVal StreamPosition As Variant, _
    22. ByVal RecognitionType As SpeechRecognitionType, _
    23. ByVal Result As ISpeechRecoResult _
    24. )
    25. Dim strText As String
    26.  
    27. ' put strText in a TextBox, or whatever..
    28. strText = Result.PhraseInfo.GetText.
    29.  
    30. End Sub

  10. #10
    Junior Member 347Studboy's Avatar
    Join Date
    Apr 2003
    Location
    New Milford, Inthemiddleofnowhere
    Posts
    17
    It's still not working... when I do this:

    VB Code:
    1. Voice = New SpVoice

    It's telling me "Declaration expected" for the Voice variable. O_0

    EDIT: Why is the font so small? Well, that coding, in case you can't read it, says "Voice = New SpVoice".

    DOUBLE EDIT: Nevermind, I think I found the problem with the font. Still need help with the code.
    Last edited by 347Studboy; Apr 20th, 2003 at 10:38 AM.
    You might see me on the Neo Productions forums!

  11. #11
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Are you getting the Intelle..(the dropdown menu) showing SpVoice object . Did you make reference ? Try without new It may work !

  12. #12
    Junior Member 347Studboy's Avatar
    Join Date
    Apr 2003
    Location
    New Milford, Inthemiddleofnowhere
    Posts
    17
    I did try without the New thing, and I did get the menu when I typed Voice.(menu pops up here). But unfortunately... even though the syntax is correct, when I actually run the program, I get an error.

    An unhandled exception of type 'System.NullReferenceException' occurred in SpeechJazz.exe

    Additional information: Object reference not set to an instance of an object.

    That's what the error says.
    You might see me on the Neo Productions forums!

  13. #13
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    What the hell is "SpeechJazz.exe " ? Is it your proj name ? Where did you get this VB6 example I might convert it on my machine ?

  14. #14
    Junior Member 347Studboy's Avatar
    Join Date
    Apr 2003
    Location
    New Milford, Inthemiddleofnowhere
    Posts
    17
    SpeechJazz is my project name. You can find the page with this example here.
    You might see me on the Neo Productions forums!

  15. #15
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I built that VB6 , but with automation ugly errors . Did you get it WORKING well in VB6 ?If so , can you send it to me hopefully I can tweak something to VB.NET proj . !

  16. #16
    Junior Member 347Studboy's Avatar
    Join Date
    Apr 2003
    Location
    New Milford, Inthemiddleofnowhere
    Posts
    17
    No, I don't even have VB6... so I can't help you there. That's my main problem; most sites offer help with VB6 or C++, not VB.Net. *Sigh*... Oh well.
    You might see me on the Neo Productions forums!

  17. #17
    Junior Member 347Studboy's Avatar
    Join Date
    Apr 2003
    Location
    New Milford, Inthemiddleofnowhere
    Posts
    17

    Talking YAY!

    Well, I did it. I got my coding to work! I haven't had too much time to play around with it, but here it is, just the same:

    VB Code:
    1. Public Class Form1
    2.     Inherits System.Windows.Forms.Form
    3. 'Declaring variables and stuff
    4.     Dim MyVoice As New SpeechLib.SpVoice()
    5.     Dim WithEvents RecoContext As New SpeechLib.SpSharedRecoContext()
    6.     Dim Grammar As SpeechLib.ISpeechRecoGrammar()
    7.  
    8. 'The "Windows Form Designer generated code" goes here....
    9.  
    10.  
    11.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    12. 'Error handling... I always use it! ;)
    13.         On Error GoTo errPro
    14. 'Making the voice say whatever is in the text box
    15.         MyVoice.Speak(TextBox1.Text, SpeechLib.SpeechVoiceSpeakFlags.SVSFlagsAsync)
    16.         GoTo Done
    17. errPro:
    18.         If MsgBox(Err.Description, MsgBoxStyle.OKCancel) = MsgBoxResult.Cancel Then Me.Close()
    19. Done:
    20.  
    21.     End Sub
    22.  
    23.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    24. 'This was the only place I could think to start the recognition; it wasn't working in General Declarations for some reason....
    25.         RecoContext.CreateGrammar(1).DictationSetState(SpeechLib.SpeechRuleState.SGDSActive)
    26.  
    27.     End Sub
    28.  
    29.     Private Sub RecoContext_Recognition(ByVal StreamNumber As Integer, ByVal StreamPosition As Object, ByVal RecognitionType As SpeechLib.SpeechRecognitionType, ByVal Result As SpeechLib.ISpeechRecoResult) Handles RecoContext.Recognition
    30.         On Error GoTo errPro
    31. 'Here it recognized something I said... so it displays the phrase it recognized with the Label1 control.
    32.         Label1.Text = Result.PhraseInfo.GetText
    33. 'Now, here's where I make the program do stuff by commanding it with my voice:
    34.         Select Case LCase(Result.PhraseInfo.GetText)
    35.             Case "mary, exit" : Me.Close()
    36.         End Select
    37. '...Well, I haven't gotten much done yet... :P
    38.         GoTo Done
    39. errPro:
    40.         If MsgBox(Err.Description, MsgBoxStyle.OKCancel) = MsgBoxResult.Cancel Then Me.Close()
    41. Done:
    42.  
    43.     End Sub
    44.  
    45.     Private Sub Label1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label1.TextChanged
    46. 'Just positioning the Label... no biggy.
    47.         Label1.Left = (Me.Size.Width - Label1.Text.Length) / 2
    48.  
    49.     End Sub
    50.  
    51. End Class

    Try it out! It's fun! Because frankly, with this and the ability to remotely control other Applications, I do sincerely believe that I can take total control over Windows itself with the sound of my voice.
    You might see me on the Neo Productions forums!

  18. #18
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Glad you got it working . I'm not at my Dev PC , so I'll try it out later...

  19. #19
    Junior Member 347Studboy's Avatar
    Join Date
    Apr 2003
    Location
    New Milford, Inthemiddleofnowhere
    Posts
    17
    Yeah, it's pretty great. *Sigh*... I've started an application that runs alongside AIM, and types into the message window whatever I say. There are also special commands for things like sending messages. It works okay so far, but it would be better if the recognition was a little more accurate.
    You might see me on the Neo Productions forums!

  20. #20
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    That's a lot of fun , interesting ! Well , MS are developing this new tech rapidly . We never thought to have a speaking or understanding progams in the past , but now it's quite easy job .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width