From 84f9aae897e89a72dbd923a2276276d5cb83a9eb Mon Sep 17 00:00:00 2001 From: Chance Nelson Date: Mon, 10 Aug 2020 18:15:52 -0700 Subject: [PATCH] add threshold flag --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.go b/main.go index 49bd694..ab6443f 100644 --- a/main.go +++ b/main.go @@ -35,10 +35,12 @@ func main() { var pulsepid int var sourceName string var unload bool + var threshold int flag.IntVar(&pulsepid, "removerlimit", -1, "for internal use only") flag.StringVar(&sourceName, "s", "", "Load PulseAudio source by name") flag.BoolVar(&unload, "u", false, "Unload supressor") + flag.IntVar(&threshold, "t", -1, "voice activation threshold") flag.Parse() if pulsepid > 0 { @@ -69,6 +71,10 @@ func main() { ui.config = readConfig() ui.librnnoise = rnnoisefile + if threshold > 0 { + ui.config.Threshold = threshold + } + if unload { paClient, err := pulseaudio.NewClient() if err != nil {