Home All Groups Group Topic Archive Search About

How I generate a tone programatically without resorting to playing a file such as MP3, WAV, etc.?

Author
21 Apr 2006 3:47 PM
alcurb
I would like to programatically generate a sine wave, for instance,
without resorting to playing a file.

My goal is to create waveforms by drawing one cycle on a control and
playing it in a loop. The tone should be played through the sound card
and not the PC speaker. Call it a simplified sound waveform
synthesizer. 

Thanks in advance.

Alcurb

Author
10 Jun 2006 12:55 AM
Andrew
As far as sending waveform data to your sound card, read up on the
DirectSound managed library.  If you're not wanting to reference a library
into your application, then you'll have to get into the Windows API to send
data to your sound card, which can get messy.

As far as generating a sine wave, if you follow a very simple formula, you
can generate sine waves.
http://www.geocities.com/SiliconValley/Campus/8645/synth.html will show you
how to create sine waves in code.

- Andrew

Show quoteHide quote
"alcurb" <a**@dolby.com> wrote in message
news:1145634441.431936.155210@t31g2000cwb.googlegroups.com...
>I would like to programatically generate a sine wave, for instance,
> without resorting to playing a file.
>
> My goal is to create waveforms by drawing one cycle on a control and
> playing it in a loop. The tone should be played through the sound card
> and not the PC speaker. Call it a simplified sound waveform
> synthesizer.
>
> Thanks in advance.
>
> Alcurb
>