c# - System.Speech down microphone sensitivity -
i know how down microphone sensitivity system.speech in c#..
to explain myself, have grammar file, , application should begin record me when sivraj (my program's name)
however, can totally different, , application understand 'sivraj'...
there part xml file :
<rule id="mouskie" scope="public"> <item> <one-of> <item>sivraj</item> </one-of> </item> <ruleref special="garbage" /> <one-of> <item> <one-of> <item>quit</item> </one-of> <tag>$.mouskie={}; $.mouskie._value="quit";</tag> // quit programm when sivraj + quit </item> ..... etc etc
and function start recognition engine :
srgsdocument xmlgrammar = new srgsdocument("grammaire.grxml"); grammar grammar = new grammar(xmlgrammar); asrengine = new speechrecognitionengine(); asrengine.setinputtodefaultaudiodevice(); asrengine.loadgrammar(grammar); asrengine.speechrecognized += asrengine_speechrecognized; asrengine.speechrecognitionrejected += asrengine_speechrecognitionrejected; asrengine.speechhypothesized += asrengine_speechhypothesized;
finally, recover data here :
recotext.text = e.result.text; devine.text = ""; affiche.text = ""; string basecommand = e.result.semantics["mouskie"].value.tostring(); commandtext.text = basecommand; if (basecommand.equals("quit")) { m_speechsynth.speech("au revoir", voicegender.male, voiceage.adult); environment.exit(0); }
in scenario not looking microphone sensitivity. believe looking phrase confidence.
when engine returns recognition results returns confidence score along it. "basically saying how confident heard said."
if (speech.recognition.recognitionresult.confidence > .20) { //do stuff } else { // ignore }
this contains value 0 1 1 being confident , 0 being background noise causing reco events. have play around confidence value makes sense since highly grammar , environment specific.
another thing change trigger word. doubt lexicon speech engine has phrase sivraj in it. in case engine try , make guess phonemes make word (you can supply them in grammar custom pronunciation if have linguistic background). start recording have better chance give more decent experience.
Comments
Post a Comment