Fixed recording float seconds

This commit is contained in:
Pünkösd Marcell 2020-09-30 05:55:32 +02:00
parent f500ee02ae
commit 05d55f0d77

View File

@ -17,7 +17,7 @@ class SlicedRecorder(Thread):
def __init__(self, slice_size: float, sample_rate=SAMPLE_RATE, microphone=MICROPHONE, dest_folder=DEST_FOLDER): def __init__(self, slice_size: float, sample_rate=SAMPLE_RATE, microphone=MICROPHONE, dest_folder=DEST_FOLDER):
super().__init__() super().__init__()
self._output_queue = Queue() self._output_queue = Queue()
self._samples_per_slice = slice_size * sample_rate self._samples_per_slice = int(slice_size * sample_rate)
self._dest_folder = dest_folder self._dest_folder = dest_folder
self._sample_rate = sample_rate self._sample_rate = sample_rate
self._inp = alsaaudio.PCM( self._inp = alsaaudio.PCM(