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

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
 
A

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top