Since the values for i2s.dma_buf_count and i2s.dma_buf_len can be somewhat of a mystery, in this example they are calculated automatically to use the least amount of DMA memory given your preference ...