Allocates and attaches a Meta on buffer
, which must be writable for that
purpose.
The fields of the Meta are directly populated from the arguments of this function.
When info
.layout is
NON_INTERLEAVED and offsets
is null
, the
offsets are calculated with a formula that assumes the planes are tightly packed and in sequence: offsets[channel] = channel *
samples
* sample_stride
It is not allowed for channels to overlap in memory, i.e. for each i in [0, channels), the range [offsets
[i], offsets
[i] + samples
* sample_stride) must not overlap with any other such range. This function will assert if the parameters
specified cause this restriction to be violated.
It is, obviously, also not allowed to specify parameters that would cause out-of-bounds memory access on buffer
. This is
also checked, which means that you must add enough memory on the buffer
before adding this meta.
buffer |
a Buffer |
info |
the audio properties of the buffer |
samples |
the number of valid samples in the buffer |
offsets |
the offsets (in bytes) where each channel plane starts in the buffer or |
the Meta that was attached on the |