473,545 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Beep from PC speaker

Hi,
I want to make a beep from PC speaker (like C++ beep(), not a beep from
sound-card).
How to do that ?
Thanks
Nov 15 '05 #1
2 13365
"Hai Ly Hoang" <No*****@Mail.c om> wrote in message
news:eB******** ******@TK2MSFTN GP12.phx.gbl...
Hi,
I want to make a beep from PC speaker (like C++ beep(), not a beep from
sound-card).
How to do that ?
Thanks


[System.Runtime. InteropServices .DllImport("ker nel32.dll")]
private static extern bool Beep( int freq, int dur );

Beep(500,1000);

Erik
Nov 15 '05 #2
using System.Runtime. InteropServices ;

[DllImport("KERN EL32.DLL",
EntryPoint="Bee p",SetLastError =true,CharSet=C harSet.Unicode,
ExactSpelling=t rue,CallingConv ention=CallingC onvention.StdCa ll)]

public static extern bool Beep(int x,int y);

//you code

Beep(500,1000); //500 and 1000 are number of pitch, and duration
--
Rami Saad
Microsoft GTSC Developer support for Middle East

"Hai Ly Hoang" <No*****@Mail.c om> wrote in message
news:eB******** ******@TK2MSFTN GP12.phx.gbl...
Hi,
I want to make a beep from PC speaker (like C++ beep(), not a beep from
sound-card).
How to do that ?
Thanks

Nov 15 '05 #3

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

Similar topics

3
3320
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
8740
by: bill_m | last post by:
Has anyone tried to use the .NET Beep function? The following works in VBA: Private Declare Function Beep Lib "Kernel32.dll" _ (ByVal X As Long, ByVal Y As Long) As Long Dim blVal As Boolean Dim dwFreq As Long Dim dwDuration As Long
5
433
by: Evgeny Zoldin | last post by:
Hi All, Does anybody know is it possible in C# call a Beep for system speaker like that one in VB but different from Microsoft.VisualBasic.Interaction.Beep() Thanks
19
56593
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....
9
8417
by: jgcrawford | last post by:
G'day, I'm writing a ringtone manager for nokia ringtones and I'd like to be able to play the ringtone on the PC speaker. I've had some success in DOS with turbo C and its sound(), delay() and nosound(). Is there anything similar for Linux? I know I can make a simple beep with '\a', but that's not what I need. If not, can someone please show...
4
3728
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
4
1780
by: Ross | last post by:
Anyone have any code that will sound a click from the PC speaker with keystrokes? Any easy way to get a beep out of the PC speaker (not through the sound card)? Thanks, Ross
5
29071
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
7409
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...
0
7664
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. ...
0
7918
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...
0
7766
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...
1
5341
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...
0
4958
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...
0
3463
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...
1
1897
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
1
1022
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.