Results 1 to 11 of 11

Thread: making a computer beep

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2002
    Posts
    89

    making a computer beep

    how can you make a computer beep?

  2. #2
    Fanatic Member Vanguard-MnC's Avatar
    Join Date
    Apr 2002
    Location
    Inactive for like ever.
    Posts
    628
    VB Code:
    1. Beep

  3. #3
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    You have a choice between using the VB built in function Beep that will beep through your soundcard (if you have one) or use the API Beep function that will send the signal through the computer speaker, no matter if you have a sound card or not (or if you have a speaker connected to your sound card).

  4. #4
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    I liked the ol' QBasic Beep - where you could give it duration, and frequency, and iterations or something.

    Making multiple beeps in VB6 is a pain in the arse...
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  5. #5
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Originally posted by rjlohan
    I liked the ol' QBasic Beep - where you could give it duration, and frequency, and iterations or something.

    Making multiple beeps in VB6 is a pain in the arse...
    The API function will allow you to do so.
    VB Code:
    1. Private Declare Function BeepAPI _
    2.  Lib "kernel32" Alias "Beep" ( _
    3.  ByVal dwFreq As Long, _
    4.  ByVal dwDuration As Long) As Long
    Best regards

  6. #6
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Groovy baby, yeah!
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  7. #7
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    The beep API has absolutely no effect when i run it. I don't seem to know why. I want to make beep songs like in qbasic...
    You just proved that sig advertisements work.

  8. #8
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Originally posted by nishantp
    The beep API has absolutely no effect when i run it. I don't seem to know why. I want to make beep songs like in qbasic...
    The dwFreq and dwDuration arguments are ignored on Win9x based systems I'm affraid.
    With systems with a sound card this function will play the default system beep on Win9x.

  9. #9
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    I'm running XP, which is NT based...I don't understand why it doesnt work. Is there a volume setting for the computer speaker?
    You just proved that sig advertisements work.

  10. #10
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Originally posted by nishantp
    I'm running XP, which is NT based...I don't understand why it doesnt work. Is there a volume setting for the computer speaker?
    I tried the following code on my XP computer without problems:
    VB Code:
    1. Private Declare Function BeepAPI _
    2.  Lib "kernel32" Alias "Beep" ( _
    3.  ByVal dwFreq As Long, _
    4.  ByVal dwDuration As Long) As Long
    5.  
    6. Private Sub Command1_Click()
    7.     BeepAPI 200, 1000
    8. End Sub

  11. #11
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    I just tried that and some variations. It seems theres something physically wrong with by speaker. Thanks anyways.



    You just proved that sig advertisements work.

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