I would like to have the following application implemented for Linux:
Constant audio capturing using ALSA and periodic compression of the recorded segments using FLAC.
A process will constantly record audio and write audio data to a buffer using ALSA. A pipe will connect the ALSA process with a child process that will read the contents of the buffer and will periodically compress segments of received data into .flac files.
Two examples that may be help to start with are attached. In 'simple_record.c', audio is captured for 5 seconds, it is saved in a buffer and written to the standard output. In 'flac_encode.c', a wav file is written and encoded to flac format. My goal is to somehow interconnect two processes like these, allowing the captured audio data to be passed to the second process in order to be periodically converted to flac files.
The period of file generation must be adjustable.