From b21a37606b016f40bd6c179834973160bdd386ca Mon Sep 17 00:00:00 2001 From: Shawn Buckley Date: Sat, 26 Mar 2022 22:56:43 -0400 Subject: [PATCH] Add method to disable speech plugin from python --- FreePIE.Core.Plugins/SpeechPlugin.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/FreePIE.Core.Plugins/SpeechPlugin.cs b/FreePIE.Core.Plugins/SpeechPlugin.cs index 4aa286ce..17de7f8e 100644 --- a/FreePIE.Core.Plugins/SpeechPlugin.cs +++ b/FreePIE.Core.Plugins/SpeechPlugin.cs @@ -24,13 +24,17 @@ public override object CreateGlobal() public override void Stop() { if (synth != null) + { synth.Dispose(); + synth = null; + } if (recognitionEngine != null) { recognitionEngine.RecognizeAsyncStop(); recognitionEngine.UnloadAllGrammars(); recognitionEngine.Dispose(); + recognitionEngine = null; } } @@ -158,5 +162,10 @@ public void selectVoice(string name) { plugin.SelectVoice(name); } + + public void disable() + { + plugin.Stop(); + } } } \ No newline at end of file