In such a case I'd probably just use a TBytesStream (one of TMemoryStream descendants), built from a dynamic array. Dynamic arrays (as far as I remember), are guaranteed to be zero-initialized from the compiler. Like this:
function CreateStream: TBytesStream;
var
Buffer: array of Byte;
const
Samples = 44100 * 2 * 10; { 10 secs at 44khz 16-bit stereo }
SizeInBytes = Samples * 2;
begin
SetLength(Buffer, SizeInBytes);
Result := TBytesStream.Create(Buffer);
end;
I will do this in the future, as it seems to make more sense than what I was doing. Thank you!