Sample buffer objects are used throughout the library to store data samples for reading or writing. They can be used directly by the DMA, as they’re cache-line-aligned, and their cache coherency is maintained by the library. The memory for sample buffers is allocated internally from memory pools and managed by the library. Each sample buffer belongs to a single memory pool, from which it was allocated, and the memory pool assigns it to the read or write queue.
SampleBuffer buf = dac.dequeue();
for (size_t i=0; i<buf.size(); i++) {
buf[i] = SAMPLES_BUFFER[i];
}
dac1.write(buf);