public override void StopASR() { #if UNIX JuliusSession.Stop(); #elif WINDOWS && NET461 sre.RecognizeAsyncStop(); SayInfoLine("ASR disabled."); #endif }
static void ASR() { #if UNIX JuliusSession s = new JuliusSession(); if (!s.Initialized) { Error("Could not initialize Julius session."); Exit(ExitResult.UNKNOWN_ERROR); } SnipsNLUEngine engine = new SnipsNLUEngine(Path.Combine("Engines", "beverage")); if (!engine.Initialized) { Error("Could not initialize SnipsNLU engine."); Exit(ExitResult.UNKNOWN_ERROR); } s.Recognized += (text) => { Info("Text: {0}", text); engine.GetSnipsIntents(text, out string[] intents, out string json, out string error); if (intents.Length > 0) { Info("Intents: {0}", intents); if (!intents.First().StartsWith("None")) { Info(intents.First().Split(':').First()); } if (!string.IsNullOrEmpty(json)) { Info("Slots: {0}", json); } } Info("Listening. Press any key to exit..."); }; s.Start(); Info("Waiting for the ASR process to become ready..."); s.Listening += () => { Info("Listening. Press any key to exit..."); }; System.Console.ReadKey(false); Info("Exiting..."); s.Stop(); #endif }
public override void StopASR() => JuliusSession.Stop();
public override void StopASR() { #if UNIX JuliusSession.Stop(); #endif }