🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: wave playback headers

#131
From: markhatesspam
Date: Thu, 12 May 2005 19:05
31 lines
1704 bytes
I assume you open the wave out device with something like this :-

HWAVEOUT phwo; WAVEFORMATEX wvfx;
MMRESULT wh;
wh=waveOutOpen(&phwo,WAVE_MAPPER,&wvfx,(DWORD)WaveOutProc,(DWORD)this,CALLBACK_FUNCTION);

When you are processing and playing back your wave headers, you must set a bool as follows :-

In your TForm1 declaration in the public section, put bool sounding;

In your code for processing the buffers, put at the top sounding=true;
In your code for processing the buffers, put at the bottom sounding=false;

Change the routine I gave you to this :-

//---------------------------------------------------------------------------
void CALLBACK WaveOutProc(HWAVEOUT waveOut,UINT uMsg,DWORD dwInstance,DWORD 
dwParam1,DWORD dwParam2)
{
   if (dwParam1==0 || Form1->sounding) return;
   WAVEHDR *mh=(WAVEHDR *)dwParam1;
   if (uMsg==MM_WOM_DONE)
   {
     waveOutUnprepareHeader(waveOut,mh,sizeof(WAVEHDR));
     mh->dwFlags=WHDR_DONE;
   }
}

HTH
Mark Jacobs
Technical Details
Message-ID: <4283a8dc@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10d0fc,771a0fcea1e567d2
X-Google-Attributes: gid10d0fc,public
X-Google-Language: ENGLISH,ASCII-7-bit
X-Newsreader: MJ News Reader
From: markhatesspam@spamcatch.com
Subject: Re: wave playback headers
Newsgroups: borland.public.cppbuilder.multimedia
NNTP-Posting-Host: 81.86.186.94
Message-ID: <4283a8dc@newsgroups.borland.com>
Date: 12 May 2005 12:05:00 -0700
X-Trace: newsgroups.borland.com 1115924700 81.86.186.94 (12 May 2005 12:05:00 -0700)
Lines: 31
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail