feat: AudioRecorder accepts device param — reads audio.device from config
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,8 +4,9 @@ import numpy as np
|
||||
|
||||
|
||||
class AudioRecorder:
|
||||
def __init__(self, sample_rate: int = 16000):
|
||||
def __init__(self, sample_rate: int = 16000, device: str | None = None):
|
||||
self.sample_rate = sample_rate
|
||||
self.device = device or None
|
||||
self._buffer: list[np.ndarray] = []
|
||||
self._stream = None
|
||||
self.is_recording = False
|
||||
@@ -25,6 +26,7 @@ class AudioRecorder:
|
||||
channels=1,
|
||||
dtype="int16",
|
||||
callback=self._callback,
|
||||
device=self.device,
|
||||
)
|
||||
self._stream.start()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user