does an audiosamplebuffer object contain wave data or just a reference to it? if it’s only a reference is it up to you to delete the original data once the audiosamplebuffer object is deleted, or is there a way to have it do this automatically? what about when you use the AudioSampleBuffer(const int numChannels, const int numSamples) constructor, where is the data stored then?
kind of… it says that memory that is allocated will be deleted automatically but it will not delete any memory that isn’t allocated. is there a way to tell it to automatically delete data that is passed in through the constructor? what happens if you call delete, does it clear the referenced memory?
I’m sure it doesn’t say anything as confusing as that!
It’s very simple - any memory it allocates internally is taken care of and you don’t need to worry about it. Or if you pass your own pointer in there, it’ll leave it alone.
yes - but obviously there’s no point in actually allocating the memory yourself - you might as well just let the object handle it. The main reason it lets you wrap up an external array is for handling arrays you have no control over, like the ones that get passed into native audio driver callbacks, etc.
Yes, but only the handling when its amount of channels or its sizes changes. But not how AudioSampleBuffer reacts, when the pointer will be deleted after some usage. Do I miss something? I sill use the online Doc. (I didnt get the SVN-Thing)
Sorry, I thought that’s what you were asking about?
If you give it some of your own data to refer to, then surely it’s just common sense that you shouldn’t delete that memory while it’s still using it (??)