473,721 Members | 2,053 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
Jul 19 '05 #1
3 3332
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

Jul 19 '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

Jul 19 '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

Jul 19 '05 #4

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

Similar topics

6
31816
by: Leo | last post by:
hi there i want python to do a beep. in the docu i found in tkinter the method bell() but the script: import Tkinter Tkinter.bell() gives the error:
19
56675
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++...
3
524
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
2
3076
by: Dragon | last post by:
When I run a make-table query, the results take over 1 minute to return. The query is making a table that has 12,000 records in it. If I run the make-table query ONLY to see the records that will be put into the table, this only takes 5 seconds. It's the making of the table that takes so long. Does anyone know what I should do to improve the return time? Also, the new table has a field in it that is an auto number. However, the auto...
4
6884
by: Rich | last post by:
Hello, I want to use the Beep() to alert users about certain messages but in my workstation I can't get a sound out of it. But Beep works in VB6. What do I need to do? Sub... .... Beep() For i = 0 to 100: Beep(): Next
4
9950
by: =?Utf-8?B?UmljaA==?= | last post by:
When I press the Enter key in a Textbox I get a beep sound. But when I press the Enter key in a combobox, I don't get the beep sound. Is there a way to suppress the beep? How to do this? Thanks
27
13792
by: MLH | last post by:
How can I turn the following into a make-table query? SELECT & " " & AS Recipient FROM tblVehicleJobs INNER JOIN tblAddnlOwnrs ON tblVehicleJobs.VehicleJobID = tblAddnlOwnrs.VehicleJobID WHERE tblVehicleJobs.VehicleJobID=GetCurrentVehicleJobID(); UNION SELECT AS Recipient FROM tblVehicleJobs INNER JOIN tblLienHolders ON tblVehicleJobs.VehicleJobID = tblLienHolders.VehicleJobID WHERE
2
4768
by: =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?= | last post by:
I have a tabcontrol where I want to capture the CTRL+C key combination. My tabcontrol has on its tabpages some treeView controls. My intention is to intercept the event of pressing the CTRL+C when one of the controls embedded in the tabControl has the focus. I'm doing this using the KeyDown event. However, when pressing the CTRL+C my computer sounds a beep - as in 'not allowed' beep. The capturing of the keycombination works fine, however,...
5
29224
by: =?Utf-8?B?UmFmYWVs?= | last post by:
I'm studying C# (I've been a VB developer). I'm making some tests and I need to use Console.Beep(), but it doesn't make any sound, no matter if I try it in VS2008 beta or VS2005. Could anybody tell my some hint abouit it? -- Rafael
0
8834
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8727
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9212
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...
0
9056
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
8002
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5973
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
4748
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2127
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.