473,386 Members | 1,720 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,386 software developers and data experts.

Beep()

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
dwFreq = 1000
dwDuration = 1000
blVal = Beep(dwFreq, dwDuration)

However, it does not work in vb.NET. The .NET beep
function will only play a chime over the Sound card. I
need to use the pc Speaker.

Any Ideas?
Jul 19 '05 #1
2 8724
I did not. The function asks for longs. Should I change
them?

How did you declare the function? Did you change the Longs toIntegers?

Jul 19 '05 #2
"bill_m" <bm*****@falls.niagara.ny.us> wrote in news:09e701c36812
$3****************@phx.gbl:
Has anyone tried to use the .NET Beep function?

function will only play a chime over the Sound card.


Is this a Windows Me/98/95 system it's running on?

From the docs:

<Quote>

Parameters

dwFreq
[in] Frequency of the sound, in hertz. This parameter must be in the
range 37 through 32,767 (0x25 through 0x7FFF).

Windows Me/98/95: The Beep function ignores this parameter.
dwDuration
[in] Duration of the sound, in milliseconds.

Windows Me/98/95: The Beep function ignores this parameter.

Windows Me/98/95: On computers with a sound card, the function plays the
default sound event. On computers without a sound card, the function
plays the standard system beep.
</Quote>

Chris
Jul 19 '05 #3

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

Similar topics

6
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:
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
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...
8
by: Marcia Gulesian | last post by:
How can I create a beep in javascript (I.E. 5.5 +) ?
2
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
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: 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()...
4
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...
4
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? ...
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
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...

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.