Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.33/5 (2 votes)
See more:
Is it possible to replace the sList i created to something with a bigger vocab?

C#
private void button2_Click(object sender, EventArgs e)
        {
            button2.Enabled = false;
            button3.Enabled = true;
            Choices sList = new Choices();
            sList.Add(new string[] { "hello", "test", "it works", "how", "are", "you", "today", "i", "am", "fine", "exit", "close" });
            Grammar gr = new Grammar(new GrammarBuilder(sList));
            try
            {
                sRecognize.RequestRecognizerUpdate();
                sRecognize.LoadGrammar(gr);
                sRecognize.SpeechRecognized +=sRecognize_SpeechRecognized;
                sRecognize.SetInputToDefaultAudioDevice();
                sRecognize.RecognizeAsync(RecognizeMode.Multiple);
           
            }

Thank you for any help.
Posted
Comments
Sergey Alexandrovich Kryukov 11-May-15 20:30pm    
Why? The existing engine already uses some dictionary. Yes, you can just create a bigger grammar, but the quality of recognition then (sigh...)...
—SA
spacemonki 12-May-15 0:37am    
I shouldve been clearer. i meant an external dictionary(like a website or a stored file), how would i call it? so when i say words other than "hello", "test", "it works", "how", "are", "you", "today", "i", "am", "fine", "exit", "close" it will recognize it.
Sergey Alexandrovich Kryukov 12-May-15 1:01am    
Why? The words you've listed are already in the general dictionary. What's your purpose?
—SA
spacemonki 12-May-15 1:33am    
I want to be able to speak an essay and for the program to pick it up and display it as text. at the moment it only picks up the words ive listed as a demo. i was wondering if there was a way to get every single word without listing each seperate word in the english language.

1 solution

spacemonki wrote:

I want to be able to speak an essay and for the program to pick it up and display it as text. at the moment it only picks up the words ive listed as a demo. i was wondering if there was a way to get every single word without listing each seperate word in the english language.
With such spelling as yours, it's hard to hope for something good. :-)
And I'm not quite joking: everyone can use spell checker when asking question. I think this is a matter of pure politeness.

Now, you can use System.Speech.Recognition.DictationGrammar:
https://msdn.microsoft.com/en-us/library/system.speech.recognition.dictationgrammar%28v=vs.110%29.aspx[^].

However, don't hold your breath — it can make the quality of recognition prohibitively poor. No wonder, so many words are so similar in pronunciation. I tried some better engines (on Android, for example), but all free-of-charge engines I tried on Windows so far was too bad to take seriously. Just give it a try though.

—SA
 
Share this answer
 
Comments
spacemonki 13-May-15 23:19pm    
Thanks for your help, Sergey.
Sergey Alexandrovich Kryukov 13-May-15 23:36pm    
You are very welcome.
Good luck, call again.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900