Article View: borland.public.cppbuilder.multimedia
Article #130Re: wave playback headers
From: Jonathan Benedicto
Date: Thu, 12 May 2005 16:42
Date: Thu, 12 May 2005 16:42
41 lines
2105 bytes
2105 bytes
"Mark Jacobs" <http://www.jacobsm.com/mjmsg.htm?mj@critical> wrote in
message news:42833a8a$1@newsgroups.borland.com...
> Sorry, you mean output not input. Here is what I use for clickless
> output :-
That's what my code does do, and then when it needs a buffer to write
to for playing, this is my code:
unsigned int j;
unsigned int BufferFilled = 0;
unsigned int PlaybackHeaderCount = PlaybackHeaders.size();
char *TempWaveBuffer;
LPWAVEHDR WaveHeader;
MMRESULT mmr;
for(i=0;i<PlaybackHeaderCount;++i)
{
WaveHeader = PlaybackHeaders[i];
if(WaveHeader->dwFlags == WHDR_DONE)
{
TempWaveBuffer = WaveHeader->lpData;
ZeroMemory(WaveHeader, sizeof(WAVEHDR));
WaveHeader->lpData = TempWaveBuffer;
WaveHeader->dwFlags = 0;
break;
}
}
if(WaveHeader->dwFlags != WHDR_DONE)
{
WaveHeader = new WAVEHDR;
WaveHeader->lpData = new char[8192];
WaveHeader->dwFlags = 0;
PlaybackHeaders.push_back(WaveHeader);
}
And then I use the WaveHeader.
Jonathan
Technical Details
Message-ID:
<42838769@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42826d8d$1@newsgroups.borland.com> <42830f37$1@newsgroups.borland.com> <42833a8a$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 From: "Jonathan Benedicto" <incorrect@no.server> Newsgroups: borland.public.cppbuilder.multimedia References: <42826d8d$1@newsgroups.borland.com> <42830f37$1@newsgroups.borland.com> <42833a8a$1@newsgroups.borland.com> Subject: Re: wave playback headers Date: Thu, 12 May 2005 12:42:18 -0400 Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 69.158.114.32 Message-ID: <42838769@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1115916137 69.158.114.32 (12 May 2005 09:42:17 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail