Here is a sample C# program which plays a 200Hz tone for 100ms using the System.Media.SoundPlayer
class:
862 chars29 lines
This program generates a sine wave at the specified frequency and duration, and then plays the sound using the SoundPlayer
class. Note that this program assumes a sample rate of 44100 Hz and a 16-bit audio format. If your system uses a different sample rate or audio format, you may need to modify the program accordingly.
gistlibby LogSnag