From 4909824ba3a37d5baf094be29a0e186b46bb590d Mon Sep 17 00:00:00 2001
From: Andres Marafioti <andimarafioti@gmail.com>
Date: Tue, 27 Aug 2024 15:30:23 +0200
Subject: [PATCH] add logging to the local audio streamer

---
 connections/local_audio_streamer.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/connections/local_audio_streamer.py b/connections/local_audio_streamer.py
index 5203785..6a3d544 100644
--- a/connections/local_audio_streamer.py
+++ b/connections/local_audio_streamer.py
@@ -3,7 +3,9 @@ import sounddevice as sd
 import numpy as np
 
 import time
+import logging
 
+logger = logging.getLogger(__name__)
 
 class LocalAudioStreamer:
     def __init__(
@@ -26,6 +28,8 @@ class LocalAudioStreamer:
             else:
                 outdata[:] = self.output_queue.get()[:, np.newaxis]
 
+        logger.debug("Available devices:")
+        logger.debug(sd.query_devices())
         with sd.Stream(
             samplerate=16000,
             dtype="int16",
@@ -33,6 +37,7 @@ class LocalAudioStreamer:
             callback=callback,
             blocksize=self.list_play_chunk_size,
         ):
+            logger.info("Starting local audio stream")
             while not self.stop_event.is_set():
                 time.sleep(0.001)
             print("Stopping recording")
-- 
GitLab