def _callback(self, in_data, frame_count, time_info, status):
"""
Callback function for continuous_record
Checks global var recording
If true, put frames into the queue - another thread will pop from the queue and write to disk
If false, shut down the recorder (we don't want silence or sudden time shifts in one recording file)
"""
if self._recording:
self._frames.put(in_data)
callback_flag = pyaudio.paContinue
else:
callback_flag = pyaudio.paComplete
return in_data, callback_flag
评论列表
文章目录