|
-
Apr 18th, 2001, 07:09 AM
#1
Can someone tell me how to use the beep api and how to get it to work
Thanx
-
Apr 18th, 2001, 07:14 AM
#2
Addicted Member
Code:
Declare Function Beep Lib "kernel32" Alias "Beep" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Call Beep(Frequency,HowLong)
i dunno what the frequency values are, the duration (HowLong) is in milliseconds. Both of those are ignored in Windows 95
When called, it makes one of those annoying sounds that you get when you push too many keys during startup
Last edited by Rh0ads; Apr 18th, 2001 at 07:18 AM.
< o >
-
Apr 18th, 2001, 10:50 AM
#3
VB also has it built-in.
It's called like:
-
Apr 18th, 2001, 01:50 PM
#4
I know but thats a little crap
-
Apr 18th, 2001, 02:50 PM
#5
Guru
In Windows NT, the dwFreq and dwDuration parameters specify the frequency and duration of the sound - I'm not sure but I think the sound comes from the PC Speaker.
In Windows 9x, the dwFreq and dwDuration parameters are ignored, and the default beep is played.
You can also check out the MessageBeep API:
Code:
Declare Function MessageBeep Lib "user32" (ByVal wType As Long) As Long
This plays one of the sounds you hear in message boxes, but without displaying a message box.
Code:
Call MessageBeep(0) ' Default sound
Call MessageBeep(vbExclamation)
Call MessageBeep(vbInformation)
Call MessageBeep(vbQuestion)
Call MessageBeep(vbCritical)
And it is also the only way to use the PC Speaker in Win9x:
Code:
Call MessageBeep(-1) ' Very short sound from PC Speaker - use in a loop to make it longer - can't change frequency
Warning: The last usage is VERY annoying in a loop.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|