Just a note that the FIFO buffer is only 32 samples deep. So functions likes fifoThreshold() can only accept 0 though 31 not 32 as states in the code notes.