

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to play Beep sound through Console in C#?
To play beep sound through Console, the code is as follows −
Example
using System; public class Demo { public static void Main(String[] args){ Console.WriteLine("Displaying standard output stream..."); Console.WriteLine("Standard Output Stream = "+Console.Out); Console.WriteLine("Beep sound through Console"); Console.Beep(); } }
Output
This will produce the following output −
Displaying standard output stream... Standard Output Stream = System.IO.TextWriter+SyncTextWriter Beep sound through Console
Example
Let us now see another example −
using System; public class Demo { public static void Main(String[] args){ Console.WriteLine("Displaying standard output stream..."); Console.WriteLine("Standard Output Stream = "+Console.Out); Console.WriteLine("Beep sound through Console"); Console.Beep(); Console.WriteLine("Beep sound through Console with frequence 1000 hertz and duration 500 milliseconds"); Console.Beep(1000, 500); } }
Output
This will produce the following output −
Displaying standard output stream... Standard Output Stream = System.IO.TextWriter+SyncTextWriter Beep sound through Console Beep sound through Console with frequence 1000 hertz and duration 500 milliseconds
- Related Questions & Answers
- How to play user modified Beep sound through Console in C#?
- How to play an android notification sound?
- How to play sound using SoundPool in Kotlin?
- How to play ringtone/alarm/notification sound in Android?
- How to play a custom ringtone/alarm sound in Android?
- How to play a custom sound on receiving notification in Android?
- How to play sound file in a web-page in the background?
- How can I play a sound when a Tkinter button is pushed?
- How to get the Standard Input and Output Stream through Console in C#?
- How to clear console in C?
- Getting the Standard Output and Standard Error Output Stream through Console in C#
- Can I play the same sound more than once at the same time with HTML5?
- Play with Chips in C++
- Check if Caps Lock and Num Lock is on or off through Console in C#
- Console Class in C#
Advertisements