Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-15 Thread fredvs
Hello. Ok, your idea is committed. https://github.com/fredvs/uos commit da316a2..5f11b62 You are added in the list of contributors. Many thanks. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/TFileStream-WriteBuffer-and-RAM-use

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-14 Thread fredvs
Hello Jose. Huh, of course, your code is more logical. OK, I understand what you mean. I will commit your idea asap. Many thanks. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/TFileStream-WriteBuffer-and-RAM-used-tp5727062p572

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-13 Thread fredvs
Hello Jose. Many thanks for your help. I will deeply study your code tonight. Write you later. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/TFileStream-WriteBuffer-and-RAM-used-tp5727062p5727096.html Sent from the Free Pascal

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-13 Thread José Mejuto
El 13/12/2016 a las 0:48, fredvs escribió: IMO, the problem does not come from PortAudio but from TFileStream.WriteBuffer that does not have enough RAM for writing. But maybe I do not catch something :-( Hello, In your code you were writing from uos to TMemoryStream (RAM) and when finished c

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-12 Thread fredvs
Hello José. I have study your code. It is nearly the one used by uos. But I do not see how it can resolve the too less RAM available. IMO, the problem does not come from PortAudio but from TFileStream.WriteBuffer that does not have enough RAM for writing. But maybe I do not catch something :-(

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-12 Thread fredvs
@ Jose : Wow many thanks. I will test and commit your code (with your name as contributor, of course). https://github.com/fredvs/uos Fre;D. - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/TFileStream-WriteBuffer-and-RAM-used-tp572706

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-11 Thread José Mejuto
El 11/12/2016 a las 14:39, fredvs escribió: @ Jose : uos uses PortAudio library to grap input from devices. I will deeply study your propositions. Hello, After a fast view of PortAudio API you can produce a code like: procedure WriteStreamToFile; var F: TFileStream; lAvailableFrames: int

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-11 Thread fredvs
@ Jonas and Michael: OK, to resume: it is not so simple... ;-) Before i find a good solution, I will block the recording to maximum one hour. If the user want to record more, he should do other recording each hour. @ Jose : uos uses PortAudio library to grap input from devices. I will deeply stud

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-10 Thread wkitty42
On 12/10/2016 08:54 AM, fredvs wrote: One minute of recording stereo 16 bit is +- 10 megas. at what sampling rate? that makes a big difference, too... if you record at 44hz and you drop to 22hz, the data size will be half... -- NOTE: No off-list assistance is given without prior approval.

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-10 Thread José Mejuto
El 09/12/2016 a las 12:15, fredvs escribió: Hello. Thanks Michael for answer. What happens with the buffer in which you had data, this we do not know. Here is the schema of recording: Hello, You working schema for recording is memory related, you must transform it in a static approach b

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-10 Thread Michael Van Canneyt
On Sat, 10 Dec 2016, fredvs wrote: Hello Michael. The RAM increase is normal... OK, I was thinking that too but... is it normal that the app crash if there are no more ram available ? If so, how to know how many ram is disponible (and then create a temporally file if too few). There is n

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-10 Thread Jonas Maebe
On 10/12/16 14:54, fredvs wrote: OK, I was thinking that too but... is it normal that the app crash if there are no more ram available ? The problem is most likely that you are running out of contiguous virtual address space, rather than out of (virtual) memory altogether. And yes, it is nor

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-10 Thread fredvs
Hello Michael. > The RAM increase is normal... OK, I was thinking that too but... is it normal that the app crash if there are no more ram available ? If so, how to know how many ram is disponible (and then create a temporally file if too few). One minute of recording stereo 16 bit is +- 10 meg

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-09 Thread Michael Van Canneyt
On Fri, 9 Dec 2016, fredvs wrote: Hello. Thanks Michael for answer. What happens with the buffer in which you had data, this we do not know. Here is the schema of recording: 1) At creation: DataRec := TMemoryStream.Create; 2 ) In loop: ... DataRec.WriteBuffer(InputBuffer[0], Length(Inp

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-09 Thread fredvs
Hello. Thanks Michael for answer. > What happens with the buffer in which you had data, this we do not know. Here is the schema of recording: 1) At creation: DataRec := TMemoryStream.Create; 2 ) In loop: ... DataRec.WriteBuffer(InputBuffer[0], Length(InputBuffer)); // RAM used increase at eac

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-08 Thread Michael Van Canneyt
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 incre

[fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-08 Thread fredvs
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 i