Creating sounds in vb6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ali Rizwan
    Banned
    Contributor
    • Aug 2007
    • 931

    Creating sounds in vb6

    Hi
    Can we make sound beeps as in we do in C and how do we
    Thanks in advance
  • fplesco
    New Member
    • Jul 2007
    • 82

    #2
    Originally posted by Ali Rizwan
    Hi
    Can we make sound beeps as in we do in C and how do we
    Thanks in advance
    Hi Ali -

    Try this

    Code:
        Public sub BeepInVB()
        Dim i As Integer
              For i =1 to 5
                    Beep
              Next i 
        End sub

    Comment

    • Ali Rizwan
      Banned
      Contributor
      • Aug 2007
      • 931

      #3
      Originally posted by fplesco
      Hi Ali -

      Try this

      Code:
          Public sub BeepInVB()
          Dim i As Integer
                For i =1 to 5
                      Beep
                Next i 
          End sub
      I have not listen any sound how can i use this code Plz reply

      Comment

      • Robbie
        New Member
        • Mar 2007
        • 180

        #4
        Quoted from a source I can't remember:
        [code=vb]
        Public Declare Function Beep Lib "kernel32" _
        (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
        'Write this code in form_load event or any other event...
        'Beep 200, 2000
        '(Where 200 will be the frequency in Hertz; range is 37
        'through 32,767
        '2000 will be duration.)
        'THIS ONLY WORKS IN NT/2000/XP. IN 95/98/ME, the freqeuncy and
        'duration parameters are ignored.[/code]
        Probably the best place to put that is in some module. Then it's out of the way.

        Comment

        Working...