473,765 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Make a Beep

Hi,
I want to throw out a series of 'beep..beep..be ep' to the speaker. How to do
that ?
Thanks
Nov 13 '05 #1
3 55949
Console.WriteLi ne("\a")

will give you one beep.

rajasi

" #Hai" <Re**********@M ail.com> wrote in message
news:#A******** ******@tk2msftn gp13.phx.gbl...
Hi,
I want to throw out a series of 'beep..beep..be ep' to the speaker. How to do that ?
Thanks

Nov 13 '05 #2
You can also use P/Invoke to call Kernel32.dll!Be ep.

It takes two arguments, the first one the frequency, and the second
one the duration and returns a bool for success.

Frequency must be from 37 to 32,767.

something like:

using System.Runtime. InteropServices ;

public class whatever {
[DllImport("Kern el32.dll")]
public static extern bool Beep(UInt32 frequency, UInt32 duration);

public static void beepTime() {
Beep(1000, 300);
System.Threadin g.Thread.Sleep( 300);
Beep(2000, 400);
System.Threadin g.Thread.Sleep( 300);
Beep(500, 200);
System.Threadin g.Thread.Sleep( 300);
}
}

-mike
MVP

" #Hai" <Re**********@M ail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi,
I want to throw out a series of 'beep..beep..be ep' to the speaker. How to do that ?
Thanks

Nov 13 '05 #3
Hai,

The best way to do this would be to add a reference to
Microsoft.Visua lBasic.dll and to call the static Beep method on the
Microsoft.Visua lBasic.Interact ion class.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni************* *@exisconsultin g.com

" #Hai" <Re**********@M ail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi,
I want to throw out a series of 'beep..beep..be ep' to the speaker. How to do that ?
Thanks

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3348
by: #Hai | last post by:
Hi, I want to throw out a series of 'beep..beep..beep' to the speaker. How to do that ? Thanks
19
56696
by: Anon Email | last post by:
Hi everyone, Let's see, now. This question is about the capabilities of ANSI C++. I want to write and compile code in ANSI C++ that, when compiled, will make the computer speaker beep; or, at least, SHOULD make the computer speaker beep. I know that whether the computer speaker actually beeps or not is largely dependent on the OS I'm using. But I'm not so much concerned about that (at this stage). I just want to know if ANSI C++...
8
9128
by: Marcia Gulesian | last post by:
How can I create a beep in javascript (I.E. 5.5 +) ?
1
1927
by: Hai Ly Hoang | last post by:
Hi, I want to make a beep (like MS-DOS beep, not a beep from sound-card). How to do that ? Thanks
2
13383
by: Hai Ly Hoang | last post by:
Hi, I want to make a beep from PC speaker (like C++ beep(), not a beep from sound-card). How to do that ? Thanks
5
15178
by: John Lee | last post by:
Hi, It's anoying each time the computer beeps when MessageBox.Show() popsup - I turned off all sound in control panel - audio setting but it still beeps. Can anyone help? Thanks! John
4
3739
by: Kartic | last post by:
Hi, My program needs to open another form(Form2) at form1 load. But Form2 always opens with a beep. How do I get rid of that beep. I tried to load form2 from Form1 activate also but with no success. Please advise. Thanks in advance. Kartic
12
5314
by: Peter Stojkovic | last post by:
I am now using Beep to make a short warning-sound in my VB-Project What is the aeqivalent command in VS.70, if i dont want use Visual Basic Run-Time Library Members Thanks Peter
6
3322
by: Michael Maes | last post by:
Hello, I'm invoking successive SendKeys.SendWait("{BACKSPACE}") SendKeys.SendWait("{DELETE}") in a loop. The issue is that it causes a Beep on every Pass. Setting the 'Handled = True' on the Control does prevent the Beep, but
4
2874
by: adi | last post by:
Hi My application has many automatic features because it is designed to run without any user interfering. In fact, my app will work on a system without a keyboard or a mouse. Anyway, from time to time, the app will perform some tasks. When running certain critical tasks I need to play some speaker sounds while they are processing. The sound should be a sequence of beeps. Just a single beep could be anoying for the human listener. On...
0
10163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9957
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.