diff --git a/cmd/treatment/main.go b/cmd/treatment/main.go index c6540a97..eb8a7e67 100644 --- a/cmd/treatment/main.go +++ b/cmd/treatment/main.go @@ -184,13 +184,6 @@ func run(rv *revid.Revid, ns *netsender.Sender, file *string, l *logger.Logger, } l.Log(logger.Info, "revid successfully reconfigured") - l.Log(logger.Debug, "checking audio file path") - f := vars["audioFilePath"] - if f != "" && *file != f { - file = &f - l.Log(logger.Info, "updated audio file path", "audioFilePath", f) - } - l.Log(logger.Debug, "checking mode") switch ns.Mode() { case modePaused: @@ -198,6 +191,14 @@ func run(rv *revid.Revid, ns *netsender.Sender, file *string, l *logger.Logger, l.Log(logger.Info, "mode is Paused, stopping revid") rv.Stop() case modeTreatment: + l.Log(logger.Debug, "checking audio file path") + f := vars["audioFilePath"] + if f != "" && *file != f { + file = &f + l.Log(logger.Info, "updated audio file path", "audioFilePath", f) + l.Log(logger.Info, "stopping audio") + stopAudio(&wg, &treating, audioQuit) + } if !treating { l.Log(logger.Info, "starting audio treatment") rv.Stop()