none
What happens to the text from Speech which doesn't recognize as command, MS Speech SDK 11 RRS feed

  • Question

  • Hello All,

    I am working on some speech enabled application using MS Speech SDK v11. I want to recognize the commands I specify in my SRGS document, at the same time, if some speak something else, I want that to be converted to simple text and be stored. I tried using Dictation mode, so that I can just continue in Dictation and get the text. Then using custom built SRGS parser, determine the commands. If the text is not predefined command, just treat it as simple text. Now problem is the AppendDictation is not working due to "Cannot find grammar referenced by this grammar." and I referred this http://stackoverflow.com/questions/9347346/appenddictation-on-microsoft-speech-platform-11-server

    I changed from Microsoft.Speech to System.Speech and interestingly found that Microsoft.Speech at least recognize the commands I specify but System.Speech is doing nothing. I am confused what to do.

    I repeat, I have simple requirement, recognize the commands I specify and if not just translate those in Text form. If this is not possible then how can I make work Speech API for dictation mode only.

    Also just a quick question, as previously, we had to train the computer to understand our speech and create profile, does current speech engine also must be trained? Or it fine tunes itself as we speak frequently?


    Thursday, July 10, 2014 6:30 PM

Answers

  • Hi Rahul,

    As you wish, check out the project from http://cmusphinx.sourceforge.net/. Please note it’s not a pure C# project. You can have a try.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    Thursday, July 17, 2014 3:35 AM
    Moderator

All replies

  • Hi Rahul,

    There are two threads about how to recognize command from speech, you can have a look at them.

    http://stackoverflow.com/questions/16002993/commands-using-speech-recognition.

    http://www.codeproject.com/Articles/483347/Speech-recognition-speech-to-text-text-to-speech-a#speechrecognizervsspeechrecognitionengine.

    Maybe some code like below.

    private static void StartRecognition()
            {
                recognizer.SpeechDetected += new EventHandler<SpeechDetectedEventArgs>(recognizer_SpeechDetected);
                recognizer.SpeechRecognitionRejected += new EventHandler<SpeechRecognitionRejectedEventArgs>(recognizer_SpeechRecognitionRejected);
                recognizer.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(recognizer_SpeechRecognized);
                recognizer.RecognizeCompleted += new EventHandler<RecognizeCompletedEventArgs>(recognizer_RecognizeCompleted);
            }
            private static void LoadGrammars()
            {
                Choices choices = new Choices(new string[] { "Lights on", "Exit", "Zoom out", "Zoom in", "Reset", "Lights off" });
                GrammarBuilder grammarBuilder = new GrammarBuilder(choices);
                Grammar grammar = new Grammar(grammarBuilder);
                recognizer.LoadGrammar(grammar);
            }
    
            private void recognizer_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
            {
                if (e.Result.Text == "Lights on")
                {
                    pictureBox1.Image = Properties.Resources.lightsOn;
                }
                else if (e.Result.Text == "Lights off")
                {
                    pictureBox1.Image = Properties.Resources.lightsOff;
                }
                else if (e.Result.Text == "Exit")
                {
                    recognizer.Dispose();
                    Application.Exit();
                }
                else if (e.Result.Text == "Zoom out")
                {
                    pictureBox1.Size = new System.Drawing.Size(135, 107);
                }
                else if (e.Result.Text == "Zoom in")
                {
                    pictureBox1.Size = new System.Drawing.Size(538, 426);
                }
                else if (e.Result.Text == "Reset")
                {
                    pictureBox1.Size = new System.Drawing.Size(269, 213);
                }
                else { 
                    //save text to file 
                }
            }
    

    Hope useful.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. &lt;br/&gt; Click &lt;a href=&quot;http://support.microsoft.com/common/survey.aspx?showpage=1&amp;scid=sw%3Ben%3B3559&amp;theme=tech&quot;&gt; HERE&lt;/a&gt; to participate the survey.

    Friday, July 11, 2014 6:14 AM
    Moderator
  • Thanks for your prompt reply. I have gone through the example and found that the RecognizeReject event could have been of some use if it could give me the rejected text as it is. Instead it actually gives us the word out of our supplied grammar and indicates that the spoken word has no sufficient confidence level to accept as any of the word, but hey there is few alternatives you might want o consider. I dont like this at all!! :-( Would you mind suggesting me some "good" or better open source Recognition engine SDK?

    Thanks again!!


    Rahul Bhosale

    Tuesday, July 15, 2014 8:50 PM
  • Hi Rahul,

    As you wish, check out the project from http://cmusphinx.sourceforge.net/. Please note it’s not a pure C# project. You can have a try.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. &lt;br/&gt; Click &lt;a href=&quot;http://support.microsoft.com/common/survey.aspx?showpage=1&amp;scid=sw%3Ben%3B3559&amp;theme=tech&quot;&gt; HERE&lt;/a&gt; to participate the survey.

    Thursday, July 17, 2014 3:35 AM
    Moderator