c# - Voice recognition using System.Speech not working correctly -


i have been trying experiment system.speech feature have seen various online videos , web articles teaching how use it, can't work somehow. no errors, program compiles should when speak nothing happens, have tried changing language en-uk , en-us did nothing. using vs17 , code follows:

    speechrecognitionengine recengine = new speechrecognitionengine(new cultureinfo("en-us"));      public form1()     {         initializecomponent();         this.transparencykey = (backcolor);         this.startposition = formstartposition.manual;         this.location = new point(convert.toint32(0.10), 300);         textbox1.visible = false;     }      private void form1_load(object sender, eventargs e)     {         choices commands = new choices();         commands.add(new string[] { "hello" });         grammarbuilder gr = new grammarbuilder();         gr.append(commands);         grammar grammar = new grammar(gr);          recengine.loadgrammarasync(grammar);         recengine.setinputtodefaultaudiodevice();         recengine.speechrecognized += recengine_speechrecognized;     }      private void recengine_speechrecognized(object sender, speechrecognizedeventargs e)     {         switch (e.result.text)         {             case "hello":                 messagebox.show("hello");                 break;         }     }      private void label1_click(object sender, eventargs e)     {     }      private void picturebox2_click(object sender, eventargs e)     {         recengine.recognizeasyncstop();     }      private void textbox1_textchanged(object sender, eventargs e)     {     }      void button1_click(object sender, eventargs e)     {         recengine.recognizeasync(recognizemode.multiple);     } } 

edit: downloaded , tested program same code below on 2 different computers , works fine of them except one. tried use mic of both computers recognized speech. none of them worked, problem lies within pc after all, might have download windows update speech feature or that. can find though?

apparently running admin fixed issue. somehow thought never reached mind.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -