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

  • Thread starter Thread starter alcurb
  • Start date Start date
A

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
 
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
 
Back
Top