views:

1034

answers:

2

Whew, big title, but yea that sums up the question.

Im working in C# with the Microsoft SAPI, using their speech Recognition in a program im working on.

what i have it doing is. grammar = objRecoContext.CreateGrammar(0);

            menuRule = grammar.Rules.Add("typewrite", SpeechRuleAttributes.SRATopLevel | SpeechRuleAttributes.SRADynamic, 1);
            object PropValue = "";

            menuRule.InitialState.AddWordTransition(null, "will", " ", SpeechGrammarWordType.SGLexical, "will", 1, ref PropValue, 1.0F);
            menuRule.InitialState.AddWordTransition(null, "New", " ", SpeechGrammarWordType.SGLexical, "New", 1, ref PropValue, 1.0F);
            menuRule.InitialState.AddWordTransition(null, "Open", " ", SpeechGrammarWordType.SGLexical, "Open", 2, ref PropValue, 1.0F);
            menuRule.InitialState.AddWordTransition(null, "Close", " ", SpeechGrammarWordType.SGLexical, "Close", 3, ref PropValue, 1.0F);

for custom words. but this will pick up more than I want. how can i fix this.

what im asking is, how can i make the m$ sapi only care about words I want it to. not every word in the default dict.

A: 

You can try using Command and Control mode for the recognizer to recognize just the words that you want. For your code, all you need to do is add

grammar.CmdSetRuleState("typewrite",SpeechRuleState.SGDSActive);

and objRecoContext.State = SpeechRecoContextState.SRCS_Enabled;

Hope this helps..

A: 

hello i working c#.net 2008 i want to use speech microsoft word in c#.net how do it? what do USING,at top program cod? thanks

student