Article View: borland.public.cppbuilder.multimedia
Article #126Re: wave playback headers
From: Mark Jacobs
Date: Thu, 12 May 2005 08:10
Date: Thu, 12 May 2005 08:10
24 lines
2044 bytes
2044 bytes
Jonathan Benedicto wrote:
> I'm trying to use a vector of WAVEHDR's in my application, so that my
> app does not have to create a new wave header when it plays a buffer.
>
> But, this always results in clicks in the audio. I know that the
> clicks are being made by the buffer system, because when I remove it,
> and create a new buffer for every time I need it, the clicks
> disappear.
>
> Does anyone have any thoughts on how to stop this ?
>
//---------------------------------------------------------------------------
void CALLBACK WaveInProc(HWAVEIN waveIn,UINT uMsg,DWORD dwInstance,DWORD
dwParam1,DWORD dwParam2)
{
if (MainForm->clsing || dwParam1==0) return;
if (uMsg==MM_WIM_DATA) MainForm->ProcessInput((WAVEHDR *)dwParam1);
}
It sounds like you are not checking whether the buffer is finished with, in
your WaveInProc routine. That is why I put "if (uMsg==MM_WIM_DATA)" in my version.
--
Mark Jacobs
http://www.dkcomputing.co.uk
Technical Details
Message-ID:
<42830f37$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!feed5.newsreader.com!newsreader.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42826d8d$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10d0fc,771a0fcea1e567d2 X-Google-Attributes: gid10d0fc,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Thu, 12 May 2005 09:10:07 +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: wave playback headers References: <42826d8d$1@newsgroups.borland.com> In-Reply-To: <42826d8d$1@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: <42830f37$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1115885367 81.144.157.8 (12 May 2005 01:09:27 -0700) Lines: 24 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!feed5.newsreader.com!newsreader.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail