c# - Speech recognition in Windows application -
here code:
private void button1_click(object sender, eventargs e) { speechrecognitionengine recognizer = new speechrecognitionengine(); grammar dictationgrammar = new dictationgrammar(); recognizer.loadgrammar(dictationgrammar); try { button1.text = "speak now"; recognizer.setinputtodefaultaudiodevice(); recognitionresult result = recognizer.recognize(); textbox1.text = result.text; } catch (invalidoperationexception exception) { textbox1.text = string.format("could not recognize input default audio device.is microphone or sound card available?\r\n{0} - {1}.", exception.source, exception.message); } { recognizer.unloadallgrammars(); } }
here not recognizing exact word giving microphone.it s taking word,which not meaningfull. how rectify problem?
Comments
Post a Comment