Skip to content
Snippets Groups Projects
Commit 4909824b authored by Andres Marafioti's avatar Andres Marafioti
Browse files

add logging to the local audio streamer

parent a6f27a28
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,9 @@ import sounddevice as sd ...@@ -3,7 +3,9 @@ import sounddevice as sd
import numpy as np import numpy as np
import time import time
import logging
logger = logging.getLogger(__name__)
class LocalAudioStreamer: class LocalAudioStreamer:
def __init__( def __init__(
...@@ -26,6 +28,8 @@ class LocalAudioStreamer: ...@@ -26,6 +28,8 @@ class LocalAudioStreamer:
else: else:
outdata[:] = self.output_queue.get()[:, np.newaxis] outdata[:] = self.output_queue.get()[:, np.newaxis]
logger.debug("Available devices:")
logger.debug(sd.query_devices())
with sd.Stream( with sd.Stream(
samplerate=16000, samplerate=16000,
dtype="int16", dtype="int16",
...@@ -33,6 +37,7 @@ class LocalAudioStreamer: ...@@ -33,6 +37,7 @@ class LocalAudioStreamer:
callback=callback, callback=callback,
blocksize=self.list_play_chunk_size, blocksize=self.list_play_chunk_size,
): ):
logger.info("Starting local audio stream")
while not self.stop_event.is_set(): while not self.stop_event.is_set():
time.sleep(0.001) time.sleep(0.001)
print("Stopping recording") print("Stopping recording")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment