This commit is contained in:
Saifeddine ALOUI 2023-12-11 01:38:03 +01:00
parent 6ae9d52d98
commit 150e7f3251

View File

@ -68,6 +68,7 @@ class AudioRecorder:
self.lollmsCom = lollmsCom
def start_recording(self):
try:
self.is_recording = True
self.audio_stream = pyaudio.PyAudio().open(
format=self.audio_format,
@ -80,7 +81,8 @@ class AudioRecorder:
self.lollmsCom.info("Recording started...")
threading.Thread(target=self._record).start()
except:
self.lollmsCom.error("No audio input found!")
def _record(self):
while self.is_recording:
data = self.audio_stream.read(self.chunk_size)