getSampleReader method
Returns a closure that reads samples of the given format
from this
buffer. Calling these closures advances the read head of this buffer.
Implementation
SampleReader getSampleReader(WavFormat format) {
return [
_readSample8bit,
_readSample16Bit,
_readSample24Bit,
_readSample32Bit,
_readSampleFloat32,
_readSampleFloat64,
][format.index];
}