🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.multimedia
Article #149

Re: memory fragmentation

#149
From: Mark Jacobs
Date: Tue, 17 May 2005 08:31
24 lines
2144 bytes
Jonathan Benedicto wrote:
> The crazy thing is that when I do use new / delete, I don't get the 
> clicks. It is just when I re-use a buffer that was previously 
> allocated that the clicks come.

 From what you have said so far, it looks like one of the entities in the wave 
header is not being set correctly, and I suspect it's the dwLoops member. I 
set dwLoops, dwBufferLength and lpData, every 1/4 second (buffer-full). This 
is what I use :-
...
   sounding=true;
   wvhd[nxtbf].lpData=wvbfr[nxtbf];
   wvhd[nxtbf].dwBufferLength=bfln[nxtbf];
   wvhd[nxtbf].dwLoops=0;
   wh=waveOutPrepareHeader(phwo,&wvhd[nxtbf],sizeof(WAVEHDR));
   if (wh==MMSYSERR_NOERROR)
     waveOutWrite(phwo,&wvhd[nxtbf],sizeof(WAVEHDR));
   else ShowMessage("waveOutPrepareHeader failed");
   sounding=false;
...
HTH
-- 
Mark Jacobs
http://www.dkcomputing.co.uk
Technical Details
Message-ID: <4289ab9f@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <42851140$1@newsgroups.borland.com> <428861c0@newsgroups.borland.com> <4288899b@newsgroups.borland.com> <4288c053@newsgroups.borland.com> <4288c29f@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10d0fc,6e41daf58c14cc3a
X-Google-Attributes: gid10d0fc,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 17 May 2005 09:31:17 +0100
From: Mark Jacobs <http://www.jacobsm.com/mjmsg.htm?mj@critical>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.multimedia
Subject: Re: memory fragmentation
References: <42851140$1@newsgroups.borland.com> <428861c0@newsgroups.borland.com> <4288899b@newsgroups.borland.com> <4288c053@newsgroups.borland.com> <4288c29f@newsgroups.borland.com>
In-Reply-To: <4288c29f@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 81.144.157.8
Message-ID: <4289ab9f@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1116318623 81.144.157.8 (17 May 2005 01:30:23 -0700)
Lines: 24
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail