Buggy hosts

the documentation to prepareToPlay() says “You should program defensively in case a buggy host exceeds this value”. i’ve been following this advice and allocating my buffers twice the maximumExpectedSamplesPerBlock.

but do i really need to do this? it would be nice to save some ram… i would think i could safely assume the most widely used DAWs aren’t going to be using a larger process block than this value, right?

thanks,
-matt

The right thing to do is to check the sizes of the incoming buffers and if they exceed the value, split them into multiple parts. That way you don’t need extra memory, just extra logic. Of course most hosts never go above the value, but better be sure. I’ve seen hosts send buffers too large during offline rendering.

2 Likes