Beep()

  • Thread starter Thread starter bill_m
  • Start date Start date
B

bill_m

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?
 
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
 
Back
Top