async void onRecognized(string message) { // handle defined meta-commands switch (message) { case "repeat": await speechOut.Repeat(); break; case "quit": await speechOut.Speak("Thanks for using our application. Closing down now..."); OnApplicationQuit(); Application.Quit(); break; case "options": string commandlist = ""; foreach (string command in speechIn.getActiveCommands()) { commandlist += command + ", "; } await speechOut.Speak("currently available commands: " + commandlist); break; } }
public async void onRecognized(string message) { Debug.Log(message); switch (message) { case "repeat": await speechOut.Repeat(); break; case "quit": await speechOut.Speak("Thanks for using our application. Closing down now..."); OnApplicationQuit(); Debug.Log("test"); Application.Quit(); break; case "options": string commandlist = ""; foreach (KeyValuePair <string, System.Action> command in keywords) { commandlist += command.Key + ", "; } await speechOut.Speak("currently available commands: " + commandlist); break; default: defaultSpeech(message); break; } }