Request: AudioBuffer::matchesShape method


#1

Instead of doing

jassert (aBuffer.getNumChannels() == anotherBuffer.getNumChannels());
jassert (aBuffer.getNumSamples() == anotherBuffer.getNumSamples());

It may be nice to do

jassert (aBuffer.matchesShape (anotherBuffer));

#2

I think what’s really missing is a structure AudioBufferSize, which contains the size + num channels. I wish I’d created one of those 15 years ago…


#3

The more general concept would be multi-dimensional arrays, like popularised by numpy, where a contiguous block of memory is treated as a X on Y on Z array…

In Python you indeed do assert aBuffer.shape == anotherBuffer.shape


#4

I like the idea… just not sure if the word “shape” is intuitive for this…? Just my penny’s worth.

Best,

Rail


#5

I borrowed the term “shape” from numpy which calls it that and which I believe to have good taste.