Open padenot opened 1 month ago
I think that's possibly already written down. The description of an interleaved buffer in 9.3.1. Arrangement of audio buffer says ...
The AudioData has a single plane, that contains a number of elements therefore equal to [[number of frames]] * [[number of channels]].
But planeIndex: 0
could maybe be optional since 0
is the only valid value when copying as an interleaved buffer.
planeIndex:0
is about the source, not the destination. We're copying from a planar buffer into an interleaved buffer here.
It could be made optional in this case, clearly indicating intent.
It is useful to copy all frames of an
AudioData
containing planar data to a buffer containing interleaved data, in one go. However,planeIndex
is required incopyTo
AudioDatacopyToOptions
, so one has to write:and this appears to copy all channels in Chrome (and soon, Firefox), despite the
planeIndex:0
bit. I think it's good behaviour and we should clarify this in the spec.