Instead of sampling with a smaller duration, copying buffer and starting the decoder, this version use 2 buffers. The decoder is started on the buffer not in use (basic double buffering). It avoid locking the access for a short duration, used for copying the data.
The data acquisition is continuous, only the pointer on the data & the buffer are updated.
Known bug: The first decoding is started even if the sampling is partial.
Instead of sampling with a smaller duration, copying buffer and starting the decoder, this version use 2 buffers. The decoder is started on the buffer not in use (basic double buffering). It avoid locking the access for a short duration, used for copying the data. The data acquisition is continuous, only the pointer on the data & the buffer are updated.
Known bug: The first decoding is started even if the sampling is partial.