Play a tone with a specific frequency in in C#
When the user clicks the Play button, the following code parses the tone's frequency (Hz) and duration (ms) from text boxes. It then calls System.Console.Beep to play the tone for the indicated duration.
int freq = int.Parse(txtFrequency.Text);
int duration = int.Parse(txtDuration.Text);
System.Console.Beep(freq, duration);



Comments