On Thu, 8 Dec 2016, fredvs wrote:

Hello.

In a audio library, it uses a buffer to record audio.

There is a main loop that store the audio-data given by the audio-input
device into the buffer.
For this TFileStream.WriteBuffer() is used.

Ok, all works well.

But I noted that the ram used increase at each loop and when the max ram is
reached, the program crash.

How must I deal with Data.WriteBuffer(), must I write it to a temp file ?

I was thinking that the memory manager will do the job when
TFileStream.WriteBuffer() is called.

WriteBuffer will write the data to file. No extra buffer is allocated.
The memory manager does not come into play.

What happens with the buffer in which you had data, this we do not know.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to