From 0fa7c744ba0306e542628cc8e3a5bf5b9ce81894 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Mon, 19 Jun 2023 16:52:08 -0600 Subject: [PATCH] Formatting --- frigate/app.py | 2 +- frigate/events/audio.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frigate/app.py b/frigate/app.py index d54a9abe2..15fb2ff69 100644 --- a/frigate/app.py +++ b/frigate/app.py @@ -388,7 +388,7 @@ class FrigateApp: if len([c for c in self.config.cameras.values() if c.audio.enabled]) > 0: audio_process = mp.Process( target=listen_to_audio, - name=f"audio_capture", + name="audio_capture", args=(self.config, self.feature_metrics), ) audio_process.daemon = True diff --git a/frigate/events/audio.py b/frigate/events/audio.py index f4de39d9a..70318dc9b 100644 --- a/frigate/events/audio.py +++ b/frigate/events/audio.py @@ -166,7 +166,7 @@ class AudioEventMaintainer(threading.Thread): if not self.feature_metrics[self.config.name]["audio_enabled"].value: return - logger.error(f"Running audio inference") + logger.error("Running audio inference") waveform = (audio / AUDIO_MAX_BIT_RANGE).astype(np.float32) model_detections = self.detector.detect(waveform) @@ -232,7 +232,8 @@ class AudioEventMaintainer(threading.Thread): try: audio = np.frombuffer(self.pipe_file.read(self.chunk_size), dtype=np.int16) self.detect_audio(audio) - except BrokenPipeError as e: + except BrokenPipeError: + self.logpipe.dump() self.restart_audio_pipe() def run(self) -> None: