none
Basic Speech Recognition Conversation RRS feed

  • Question

  • Hello Everyone,

    I have working with some of Microsoft's Speech Recognition and I want to say something like Hello and then the computer would say How are you?. I got the part down but the next part is tricky. I want it to remember the question and when I give an answer he answers back

    case "Hello":
     jarvis.Speak("Hello Sir, How are you?");
         //Listens for Answer here and Responds
    break;

    Saturday, January 27, 2018 1:16 AM

All replies

  • Hi,

    >>  I want it to remember the question

    What do you mean by  "remember the question "

    Do you mean save the string to a list or any other places ?

    SpeechRecognized raised when the System.Speech.Recognition.SpeechRecognitionEngine receives input  that matches any of its loaded and enabled System.Speech.Recognition.Grammar objects.

      recognizer.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(recognizer_SpeechRecognized);

    then , you can get the input text on this event and do what you want.

    string text = e.Result.Text;

    list.add (text);//add to a list

    case "Hello":

    jarvis.Speak("Hello Sir, How are you?");

    If I have any misunderstanding, maybe you can rephrase your question and give us more context.

    Best Regards,

    Bob


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Bob Ding Monday, January 29, 2018 7:30 AM
    Monday, January 29, 2018 7:22 AM