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
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")
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