Short Speech Code :)

This is a discussion on Short Speech Code :) within the C# Programming forums, part of the General Programming Boards category; Really need help I got finished all the code..but i wanted you to help me for understanding the two lines ...

  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    2

    Short Speech Code :)

    Really need help I got finished all the code..but i wanted you to help me for understanding the two lines (the first steps)
    this is a code of .. SPEECH to TEXT ..


    This is the lines that i need you to explain to me

    you need to add a SpSharedRecoContext object and create an ISpeechRecoGrammar object for it. Then Add a RecognitionHandler to it...

    Add another Button and a TextBox to your form and create the objects there. Then add a handler to tie into the listeners Recognition event...
    view sourceprint?



    and this is all the quote code
    Code:
    private void btnListen_Click(object sender, EventArgs e)
    {
        // Speech Recognition Object
        SpSharedRecoContext listener;
        // Grammar object
        ISpeechRecoGrammar grammar;
     listener = new SpeechLib.SpSharedRecoContext();
    listener.Recognition += new_ISpeechRecoContextEvents_RecognitionEventHandler (listener_Reco);
        grammar = listener.CreateGrammar(0);
        grammar.Dictationload("", SpeechLoadOption.SLOStatic);
        grammar.DictationSetState(SpeechRuleState.SGDSActive);
    }
    
    public void listener_Reco(int StreamNumber, object StreamPosition, SpeechRecognitionType RecognitionType, ISpeechRecoResult Result)
    {
        string heard = Result.PhraseInfo.GetText(0, -1, true);
        textBox1.Text += heard;
    }

  2. #2
    Registered User
    Join Date
    Mar 2009
    Location
    england
    Posts
    209
    Which third party speech recognition library are you using?

  3. #3
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,652
    Looks like Microsoft SAPI

  4. #4
    Registered User
    Join Date
    Aug 2010
    Posts
    2
    Quote Originally Posted by theoobe View Post
    Which third party speech recognition library are you using?
    yes. Microsoft SAPI

  5. #5
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,652
    So you found this post, but it wasn't enough hand-holding so you cross-posted in hopes to get someone to do the legwork for you?

    Did you try searching the web for SAPI tutorial???

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 14
    Last Post: 03-11-2010, 08:08 PM
  2. shortening this short code? : binary to int casting
    By OldGit in forum C Programming
    Replies: 21
    Last Post: 02-25-2009, 11:10 AM
  3. Seems like correct code, but results are not right...
    By OmniMirror in forum C Programming
    Replies: 4
    Last Post: 02-13-2003, 12:33 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Replies: 4
    Last Post: 01-15-2002, 11:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21