Michael
Tue May 10 21:43:13 CDT 2005
On Tue, 10 May 2005 13:44:22 -0400, "William DePalo [MVP VC++]"
<willd.no.spam@mvps.org> wrote:
>"Michael Gray" <fleetg@newsguy.spam.com> wrote in message
>news:str081p6gqf3np9b3vb78cnleisg3d9p2g@4ax.com...
>> 2) It is NOT a sine wave. It is a distorted square wave.
>
>I didn't know that, thanks for the correction.
>
>> The 'easiest' is to record the sine wave that you want to a file, then
>> play that file.
>
>The wave file format is pretty simple and the mmio... functions are easy to
>use so with a little math it shouldn't be hard to create a file on the fly
>and loop the playback, no?
>
>Regards,
>Will
>
For a programmer with a math and computing degree it would be a
peice-of-cake.
Otherwise, I'm not so sure.
In any case, if you are going to the trouble of creating a file, with
the attendant problems of getting the headers etc right, it is much
easier to directly put those numbers into a DirectSound PCM buffer,
and output using DirectSound.
Even this is not simple.
If the frequency of the sound is set to one or two, then generate a
wav file or two using say Cooledit, then play with mmio, or
directsound.
If the frequency needs to be extempore, then you will need to do
something else.
As an example that may be used as a basis for experimentation:
http://www.codeproject.com/audio/SoundGenerator.asp
Michael Gray, BSc, (Math Sci, Computing Sci) MACS, MRSA