473,405 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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 13334
"Hai Ly Hoang" <No*****@Mail.com> wrote in message
news:eB**************@TK2MSFTNGP12.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("kernel32 .dll")]
private static extern bool Beep( int freq, int dur );

Beep(500,1000);

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

[DllImport("KERNEL32.DLL",
EntryPoint="Beep",SetLastError=true,CharSet=CharSe t.Unicode,
ExactSpelling=true,CallingConvention=CallingConven tion.StdCall)]

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.com> wrote in message
news:eB**************@TK2MSFTNGP12.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
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
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...
5
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
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...
9
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...
4
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...
4
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
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.