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);

  

 

What did you think of this article?




Trackbacks
  • No trackbacks exist for this post.
Comments
  • No comments exist for this post.
Leave a comment

Submitted comments are subject to moderation before being displayed.

 Name

 Email (will not be published)

 Website

Your comment is 0 characters limited to 3000 characters.