Reputation: 161
I put the word to microsoft TTS And I wanted to ask is there a code to remove a word from the list.
to add word i use this
_recognizer.LoadGrammar(new Grammar(new GrammarBuilder("dog")));
_recognizer.LoadGrammar(new Grammar(new GrammarBuilder("cat")));
_recognizer.LoadGrammar(new Grammar(new GrammarBuilder("fish")));
Upvotes: 0
Views: 217
Reputation: 7025
You can use the UnloadGrammar()
method.
You should probably keep a reference to the grammars though, so you can unload them easily.
Like this for example:
var grammar1 = new Grammar(new GrammarBuilder("dog"));
_recognizer.LoadGrammar(grammar1);
And to unload:
_recognizer.UnloadGrammar(grammar1);
You might be able to unload a grammar like this as well, not sure:
_recognizer.UnloadGrammar(new Grammar(new GrammarBuilder("dog")));
Documentation:
Upvotes: 1