I am also not quite sure whether we have the same idea of the intended functionality in our heads.
The logger has two modes at the moment:
1.) time-triggered logging
Thats the base functionality you had already built in the original version: define time windows (eg. sunrise / sunset) and then record in those time windows for one minute and pause for four minutes or something similar.
2.) sound-level triggered recordings: define define time windows (eg. sunrise / sunset) and a number of samples that are being recorded whenever the soundlevel exceeds the threshold. This is called MIN_BLOCKS at the moment. At 48ksps sample rate, a MIN_BLOCKS of 375 is the equivalent of one second.
However, the behaviour at the moment is a mixture of the two: a sound-level triggered recording to a file, where all the sound events are stuffed together and after the defined time span (one minute) of sound/no sound, the file is closed.
It would be desirable, that the trigger event triggers the beginning of the recording and then after a predefined length, the file is closed and a new file is opened, which the waits for the next trigger event. If a new trigger event occurs during recording, then the recording should be prolonged to be the predefined length from the time of that new trigger event. (Of course, we should define a maximum length of a recording, even when new triggers arrive very frequently . . .). I hope this makes sense in a way ;-).