Thursday, 17 September 2015

How to add basic sounds to a .NET console application

How to add basic sounds to a .NET console application:

Today we will look how to add basic sounds to our .Net Console application

Create a Console Application:

The Console object has a Beep method which has a parameterless version:


It plays a short beep sound. If you’re not satisfied with it you can go for the overloaded Beep method that accepts a frequency in hertz and a duration in milliseconds.

The lower the frequency value the deeper the sound:

Console.Beep(100, 5000);

That sounds like an organ.

Console.Beep(10000, 5000);

That on the other hand just sounds awful.


Post a Comment