public Assistant(string userName, string assistantName, string pluginDir, float confidence = 0) { this.userName = userName; this.assistantName = assistantName; recognizer = new SpeechWrapper(assistantName, confidence); recognizer.getPlugins(pluginDir); recognizer.beginRecognition(); }
/// <summary> /// create basic grammar, then load basic grammar and other grammars into the speech wrapper /// </summary> /// <param name="speechWrapper"></param> public void loadDictionaryGrammar(SpeechWrapper speechWrapper) { if (phraseCommands.Count > 0) { Choices dicChoices = new Choices(phraseCommands.Keys.ToArray()); GrammarBuilder gBuilder = new GrammarBuilder(); gBuilder.Append(dicChoices); basicGrammar = new Grammar(gBuilder); speechWrapper.loadGrammar(basicGrammar); } foreach (Grammar gram in grammars.Keys) { speechWrapper.loadGrammar(gram); } }
/// <summary> /// use this method to add phrase commands through the addPhraseCommandProcess /// </summary> /// <param name="speechWrapper"></param> public abstract void setUp(SpeechWrapper speechWrapper);