Click here to Skip to main content
15,891,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I'm a newbie to both Speech Recognition and C#. I'm working on a project which includes distinguishing commands from normal conversation. I added a custom grammar that indentifies four commands (as of now) namely, 'next', 'previous', 'home', 'end'.

But when I speak some normal sentences/words, the SpeechRecognitionEngine relates the words with those in the customed Grammar and act accordingly. I tried the 'RecognizedWordUnit.Confidence' property as well, it corrected the issue to some level but not fully.

Anybody please suggest, how can I make my Speech Engine to recongnize well just the command words and ignoring the rest of speech.


Thank You

Manjinder
Posted

If you're listening for both at the same time, you'll have to put a single word in the command list to get the attention of a seperate command listener.

Basically, you listen for a single word, like "computer" or "command", then when that command is heard, you change out the commands in the list and listen for those specific commands.
 
Share this answer
 
I'm listening for some specific words only through SpeechRecognitionEngine. Snippet of my code goes as


RecEngine = new SpeechRecognitionEngine();
RecEngine.SetInputToDefaultAudioDevice();

mygrammar = sampleGrammar();
RecEngine.LoadGrammar(mygrammar);
RecEngine.SpeechRecognized += (s, args) =>
{

foreach (RecognizedWordUnit word in args.Result.Words)
{
if (word.Confidence > 0.9)
output += word.Text;

}
};

private Grammar sampleGrammar()
{
Choices choices = new Choices("next", "previous", "home", "end");
builder = new GrammarBuilder(choices);
Grammar gr = new Grammar(builder);
return gr;
}


So, when i speak some sentence like 'I want rest'. It picks and relates 'rest' as 'next', similarly 'roam' as 'home' etc. I want to improve the Speech Recognition, but not sure how to do that.

Many Thanks!

Manjinder
 
Share this answer
 
v2

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