By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 904 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

Beep()

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.