Skip to content

Commit

Permalink
Add method to disable speech plugin from python
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawn Buckley authored and Shawn Buckley committed Mar 27, 2022
1 parent 97afcae commit b21a376
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions FreePIE.Core.Plugins/SpeechPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -158,5 +162,10 @@ public void selectVoice(string name)
{
plugin.SelectVoice(name);
}

public void disable()
{
plugin.Stop();
}
}
}

0 comments on commit b21a376

Please sign in to comment.