Results 1 to 5 of 5

Thread: Beep

  1. #1
    billfaceuk
    Guest
    Can someone tell me how to use the beep api and how to get it to work

    Thanx

  2. #2
    Addicted Member
    Join Date
    Feb 2001
    Location
    Upstate NY
    Posts
    210
    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 >

  3. #3
    Matthew Gates
    Guest
    VB also has it built-in.

    It's called like:


    Code:
    Beep

  4. #4
    billfaceuk
    Guest
    I know but thats a little crap

  5. #5
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    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
  •  



Click Here to Expand Forum to Full Width